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

Unified Diff: runtime/bin/string_stream.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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/bin/socket_stream_impl.dart ('k') | runtime/lib/array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/string_stream.dart
diff --git a/runtime/bin/string_stream.dart b/runtime/bin/string_stream.dart
index a5fa6ac000d43a625faf368aa97a025d3516b0ed..53c61bb671b17755a562fb688236689154d3788b 100644
--- a/runtime/bin/string_stream.dart
+++ b/runtime/bin/string_stream.dart
@@ -10,7 +10,7 @@ abstract class _StringDecoder {
int write(List<int> buffer);
// Returns whether any decoded data is available.
- bool isEmpty();
+ bool get isEmpty;
// Returns the number of available decoded characters.
int available();
@@ -78,12 +78,12 @@ class _StringDecoderBase implements _StringDecoder {
return buffer.length;
}
- bool isEmpty() => _result.isEmpty();
+ bool get isEmpty => _result.isEmpty;
int get lineBreaks => _lineBreaks;
String decoded([int len]) {
- if (isEmpty()) return null;
+ if (isEmpty) return null;
String result;
if (len !== null && len < available()) {
@@ -99,7 +99,7 @@ class _StringDecoderBase implements _StringDecoder {
}
}
_resultOffset += result.length;
- while (!_lineBreakEnds.isEmpty() &&
+ while (!_lineBreakEnds.isEmpty &&
_lineBreakEnds.first() < _charOffset + _resultOffset) {
_lineBreakEnds.removeFirst();
_lineBreaks--;
@@ -109,7 +109,7 @@ class _StringDecoderBase implements _StringDecoder {
}
String get decodedLine {
- if (_lineBreakEnds.isEmpty()) return null;
+ if (_lineBreakEnds.isEmpty) return null;
int lineEnd = _lineBreakEnds.removeFirst();
int terminationSequenceLength = 1;
if (_result[lineEnd - _charOffset] == LF &&
@@ -387,7 +387,7 @@ class _StringInputStream implements StringInputStream {
Encoding get encoding => _encoding;
- bool get closed => _inputClosed && _decoder.isEmpty();
+ bool get closed => _inputClosed && _decoder.isEmpty;
void set onData(void callback()) {
_clientDataHandler = callback;
@@ -413,7 +413,7 @@ class _StringInputStream implements StringInputStream {
void _onData() {
_readData();
- if (!_decoder.isEmpty() && _clientDataHandler !== null) {
+ if (!_decoder.isEmpty && _clientDataHandler !== null) {
_clientDataHandler();
}
if (_decoder.lineBreaks > 0 && _clientLineHandler !== null) {
@@ -425,7 +425,7 @@ class _StringInputStream implements StringInputStream {
void _onClosed() {
_inputClosed = true;
- if (_decoder.isEmpty() && _clientCloseHandler != null) {
+ if (_decoder.isEmpty && _clientCloseHandler != null) {
_clientCloseHandler();
_closed = true;
} else {
@@ -445,7 +445,7 @@ class _StringInputStream implements StringInputStream {
(_clientDataHandler === null && _clientLineHandler === null)) {
_input.onData = null;
} else if (_clientDataHandler !== null) {
- if (_decoder.isEmpty()) {
+ if (_decoder.isEmpty) {
_input.onData = _onData;
} else {
_input.onData = null;
@@ -490,7 +490,7 @@ class _StringInputStream implements StringInputStream {
if (!_closed) {
// Schedule data callback if string data available.
if (_clientDataHandler != null &&
- !_decoder.isEmpty() &&
+ !_decoder.isEmpty &&
_scheduledDataCallback == null) {
if (_scheduledLineCallback != null) {
_scheduledLineCallback.cancel();
@@ -500,7 +500,7 @@ class _StringInputStream implements StringInputStream {
// Schedule line callback if a line is available.
if (_clientLineHandler != null &&
- (_decoder.lineBreaks > 0 || (!_decoder.isEmpty() && _inputClosed)) &&
+ (_decoder.lineBreaks > 0 || (!_decoder.isEmpty && _inputClosed)) &&
_scheduledLineCallback == null) {
if (_scheduledDataCallback != null) {
_scheduledDataCallback.cancel();
@@ -509,7 +509,7 @@ class _StringInputStream implements StringInputStream {
}
// Schedule close callback if no more data and input is closed.
- if (_decoder.isEmpty() &&
+ if (_decoder.isEmpty &&
_inputClosed &&
_scheduledCloseCallback == null) {
_scheduledCloseCallback = new Timer(0, issueCloseCallback);
« no previous file with comments | « runtime/bin/socket_stream_impl.dart ('k') | runtime/lib/array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698