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

Side by Side Diff: runtime/lib/byte_array.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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class Int8List { 5 patch class Int8List {
6 /* patch */ factory Int8List(int length) { 6 /* patch */ factory Int8List(int length) {
7 return new _Int8Array(length); 7 return new _Int8Array(length);
8 } 8 }
9 9
10 /* patch */ factory Int8List.view(ByteArray array, 10 /* patch */ factory Int8List.view(ByteArray array,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 bool every(bool f(element)) { 148 bool every(bool f(element)) {
149 return Collections.every(this, f); 149 return Collections.every(this, f);
150 } 150 }
151 151
152 bool some(bool f(element)) { 152 bool some(bool f(element)) {
153 return Collections.some(this, f); 153 return Collections.some(this, f);
154 } 154 }
155 155
156 bool isEmpty() { 156 bool get isEmpty {
157 return this.length === 0; 157 return this.length === 0;
158 } 158 }
159 159
160 int get length { 160 int get length {
161 return _length(); 161 return _length();
162 } 162 }
163 163
164 // Methods implementing the List interface. 164 // Methods implementing the List interface.
165 165
166 set length(newLength) { 166 set length(newLength) {
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 } 1626 }
1627 1627
1628 bool every(bool f(element)) { 1628 bool every(bool f(element)) {
1629 return Collections.every(this, f); 1629 return Collections.every(this, f);
1630 } 1630 }
1631 1631
1632 bool some(bool f(element)) { 1632 bool some(bool f(element)) {
1633 return Collections.some(this, f);; 1633 return Collections.some(this, f);;
1634 } 1634 }
1635 1635
1636 bool isEmpty() { 1636 bool get isEmpty {
1637 return this.length === 0; 1637 return this.length === 0;
1638 } 1638 }
1639 1639
1640 abstract int get length; 1640 abstract int get length;
1641 1641
1642 // Methods implementing the List interface. 1642 // Methods implementing the List interface.
1643 1643
1644 set length(newLength) { 1644 set length(newLength) {
1645 throw new UnsupportedError( 1645 throw new UnsupportedError(
1646 "Cannot resize a non-extendable array"); 1646 "Cannot resize a non-extendable array");
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 } 2411 }
2412 _rangeCheck(this.length, start, length); 2412 _rangeCheck(this.length, start, length);
2413 return _array.subByteArray(_offset + start, length); 2413 return _array.subByteArray(_offset + start, length);
2414 } 2414 }
2415 2415
2416 static const int _BYTES_PER_ELEMENT = 8; 2416 static const int _BYTES_PER_ELEMENT = 8;
2417 final ByteArray _array; 2417 final ByteArray _array;
2418 final int _offset; 2418 final int _offset;
2419 final int _length; 2419 final int _length;
2420 } 2420 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698