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

Unified Diff: runtime/lib/string_buffer_patch.dart

Issue 2767533002: Revert "Fix observatory tests broken by running dartfmt." (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « runtime/lib/stopwatch_patch.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_buffer_patch.dart
diff --git a/runtime/lib/string_buffer_patch.dart b/runtime/lib/string_buffer_patch.dart
index 9d51f59d5ef61be38c9e6aae0005b34d80176969..8271cc96e3da366e5db30b62015958ffa8b18913 100644
--- a/runtime/lib/string_buffer_patch.dart
+++ b/runtime/lib/string_buffer_patch.dart
@@ -4,8 +4,7 @@
import 'dart:typed_data' show Uint16List;
-@patch
-class StringBuffer {
+@patch class StringBuffer {
static const int _BUFFER_SIZE = 64;
static const int _PARTS_TO_COMPACT = 128;
static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8;
@@ -51,24 +50,20 @@ class StringBuffer {
int _bufferCodeUnitMagnitude = 0;
/// Creates the string buffer with an initial content.
- @patch
- StringBuffer([Object content = ""]) {
+ @patch StringBuffer([Object content = ""]) {
write(content);
}
- @patch
- int get length => _partsCodeUnits + _bufferPosition;
+ @patch int get length => _partsCodeUnits + _bufferPosition;
- @patch
- void write(Object obj) {
+ @patch void write(Object obj) {
String str = '$obj';
if (str.isEmpty) return;
_consumeBuffer();
_addPart(str);
}
- @patch
- void writeCharCode(int charCode) {
+ @patch void writeCharCode(int charCode) {
if (charCode <= 0xFFFF) {
if (charCode < 0) {
throw new RangeError.range(charCode, 0, 0x10FFFF);
@@ -88,8 +83,7 @@ class StringBuffer {
}
}
- @patch
- void writeAll(Iterable objects, [String separator = ""]) {
+ @patch void writeAll(Iterable objects, [String separator = ""]) {
Iterator iterator = objects.iterator;
if (!iterator.moveNext()) return;
if (separator.isEmpty) {
@@ -105,26 +99,23 @@ class StringBuffer {
}
}
- @patch
- void writeln([Object obj = ""]) {
+ @patch void writeln([Object obj = ""]) {
write(obj);
write("\n");
}
/** Makes the buffer empty. */
- @patch
- void clear() {
+ @patch void clear() {
_parts = null;
_partsCodeUnits = _bufferPosition = _bufferCodeUnitMagnitude = 0;
}
/** Returns the contents of buffer as a string. */
- @patch
- String toString() {
+ @patch String toString() {
_consumeBuffer();
- return (_partsCodeUnits == 0)
- ? ""
- : _StringBase._concatRange(_parts, 0, _parts.length);
+ return (_partsCodeUnits == 0) ?
+ "" :
+ _StringBase._concatRange(_parts, 0, _parts.length);
}
/** Ensures that the buffer has enough capacity to add n code units. */
@@ -178,9 +169,9 @@ class StringBuffer {
if (_partsCodeUnitsSinceCompaction < _PARTS_TO_COMPACT_SIZE_LIMIT) {
String compacted = _StringBase._concatRange(
_parts,
- _partsCompactionIndex, // Start
- _partsCompactionIndex + _PARTS_TO_COMPACT // End
- );
+ _partsCompactionIndex, // Start
+ _partsCompactionIndex + _PARTS_TO_COMPACT // End
+ );
_parts.length = _parts.length - _PARTS_TO_COMPACT;
_parts.add(compacted);
}
« no previous file with comments | « runtime/lib/stopwatch_patch.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698