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

Unified Diff: sdk/lib/_internal/compiler/js_lib/core_patch.dart

Issue 790013002: Make StringBuffer.write easier to inline (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/core_patch.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/core_patch.dart b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
index 9f5bf1c562b4bdb01baf7416bbc97039de720deb..c0180d8322342b025b898e259fe3fcfa0c2307cb 100644
--- a/sdk/lib/_internal/compiler/js_lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
@@ -373,13 +373,16 @@ class StringBuffer {
@patch
void write(Object obj) {
- String str = obj is String ? obj : "$obj";
- _contents = Primitives.stringConcatUnchecked(_contents, str);
+ _writeString('$obj');
}
@patch
void writeCharCode(int charCode) {
- write(new String.fromCharCode(charCode));
+ _writeString(new String.fromCharCode(charCode));
+ }
+
+ void _writeString(str) {
+ _contents = Primitives.stringConcatUnchecked(_contents, str);
}
@patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698