Chromium Code Reviews| Index: lib/coreimpl/string_buffer.dart |
| =================================================================== |
| --- lib/coreimpl/string_buffer.dart (revision 13856) |
| +++ lib/coreimpl/string_buffer.dart (working copy) |
| @@ -24,7 +24,7 @@ |
| } |
| bool isEmpty() { |
| - return _length === 0; |
| + return _length == 0; |
|
ahe
2012/10/22 09:05:21
0 should be on the left-hand side.
floitsch
2012/10/22 12:07:37
_length is an integer. It should not make any diff
|
| } |
| /** |
| @@ -32,7 +32,7 @@ |
| */ |
| StringBuffer add(Object obj) { |
| String str = obj.toString(); |
| - if (str === null || str.isEmpty()) { |
| + if (str == null || str.isEmpty()) { |
| return this; |
| } |
| _buffer.add(str); |
| @@ -71,8 +71,8 @@ |
| * Returns the contents of buffer as a concatenated string. |
| */ |
| String toString() { |
| - if (_buffer.length === 0) return ""; |
| - if (_buffer.length === 1) return _buffer[0]; |
| + if (_buffer.length == 0) return ""; |
|
ahe
2012/10/22 09:05:21
0 on left-hand side.
floitsch
2012/10/22 12:07:37
no need.
|
| + if (_buffer.length == 1) return _buffer[0]; |
|
ahe
2012/10/22 09:05:21
1 on left-hand side
floitsch
2012/10/22 12:07:37
no need.
|
| String result = StringImplementation.concatAll(_buffer); |
| _buffer.clear(); |
| _buffer.add(result); |