Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1909)

Unified Diff: dart/runtime/lib/string_buffer_patch.dart

Issue 11565034: Improve performance of dart2js StringBuffer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated to lib_v2 and private libraries. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/runtime/lib/string_buffer_patch.dart
diff --git a/dart/sdk/lib/core/string_buffer.dart b/dart/runtime/lib/string_buffer_patch.dart
similarity index 64%
copy from dart/sdk/lib/core/string_buffer.dart
copy to dart/runtime/lib/string_buffer_patch.dart
index 71bf31d2a0066e8590d2d7f8182061be9a2a367a..841fc4f884602dc757f697784a1615af28925f43 100644
--- a/dart/sdk/lib/core/string_buffer.dart
+++ b/dart/runtime/lib/string_buffer_patch.dart
@@ -1,39 +1,10 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.core;
-
-/**
- * The StringBuffer class is useful for concatenating strings
- * efficiently. Only on a call to [toString] are the strings
- * concatenated to a single String.
- */
-abstract class StringBuffer {
-
- /// Creates the string buffer with an initial content.
- factory StringBuffer([Object content = ""]) => new _StringBufferImpl(content);
-
- /// Returns the length of the buffer.
- int get length;
-
- // Returns whether the buffer is empty.
- bool get isEmpty;
-
- /// Converts [obj] to a string and adds it to the buffer.
- void add(Object obj);
-
- /// Adds the string representation of [charCode] to the buffer.
- void addCharCode(int charCode);
-
- /// Adds all items in [objects] to the buffer.
- void addAll(Iterable objects);
-
- /// Clears the string buffer.
- void clear();
-
- /// Returns the contents of buffer as a concatenated string.
- String toString();
+patch /* abstract */ class StringBuffer {
+ /* patch */ factory StringBuffer([Object content = ""])
+ => new _StringBufferImpl(content);
}
class _StringBufferImpl implements StringBuffer {
« no previous file with comments | « dart/runtime/lib/lib_sources.gypi ('k') | dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698