Chromium Code Reviews| Index: dart/sdk/lib/core/string_buffer.dart |
| diff --git a/dart/sdk/lib/core/string_buffer.dart b/dart/sdk/lib/core/string_buffer.dart |
| index 3c517ea86be339d847b6ed71b7ec5ad17a60c50f..89b0d212e70511730b09bdd81e3c53da0ea78f2b 100644 |
| --- a/dart/sdk/lib/core/string_buffer.dart |
| +++ b/dart/sdk/lib/core/string_buffer.dart |
| @@ -54,8 +54,8 @@ class _StringBufferImpl implements StringBuffer { |
| /// Adds [obj] to the buffer. |
| void add(Object obj) { |
| - String str = obj.toString(); |
| - if (str == null || str.isEmpty) return; |
| + String str = '$obj'; |
|
srdjan
2012/12/20 16:40:29
For the VM, string interpolation is slower than ca
Ivan Posva
2012/12/20 16:42:41
I do not see the purpose of this change. Please ex
ahe
2012/12/20 17:10:37
The purpose of this change is to get sane semantic
sra1
2012/12/20 19:07:41
obj.toString() should almost never be called expli
ahe
2012/12/21 11:23:38
I have changed the code to use an explicit check a
|
| + if (str.isEmpty) return; |
| _buffer.add(str); |
| _length += str.length; |
| } |