| OLD | NEW |
| 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 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1609 int setFloat64(int byteOffset, double value) { | 1609 int setFloat64(int byteOffset, double value) { |
| 1610 return _array._setFloat64(_offset + byteOffset, value); | 1610 return _array._setFloat64(_offset + byteOffset, value); |
| 1611 } | 1611 } |
| 1612 | 1612 |
| 1613 final _ByteArrayBase _array; | 1613 final _ByteArrayBase _array; |
| 1614 final int _offset; | 1614 final int _offset; |
| 1615 final int _length; | 1615 final int _length; |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 | 1618 |
| 1619 // TODO(floitsch): extending the collection adds extra cost (because of type |
| 1620 // parameters). Consider copying the functions from Collection into this class |
| 1621 // and just implementing Collection<int>. |
| 1619 class _ByteArrayViewBase extends Collection<int> { | 1622 class _ByteArrayViewBase extends Collection<int> { |
| 1620 num operator[](int index); | 1623 num operator[](int index); |
| 1621 | 1624 |
| 1622 // Methods implementing the Collection interface. | 1625 // Methods implementing the Collection interface. |
| 1623 | 1626 |
| 1624 void forEach(void f(element)) { | 1627 void forEach(void f(element)) { |
| 1625 var len = this.length; | 1628 var len = this.length; |
| 1626 for (var i = 0; i < len; i++) { | 1629 for (var i = 0; i < len; i++) { |
| 1627 f(this[i]); | 1630 f(this[i]); |
| 1628 } | 1631 } |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2410 } | 2413 } |
| 2411 _rangeCheck(this.length, start, length); | 2414 _rangeCheck(this.length, start, length); |
| 2412 return _array.subByteArray(_offset + start, length); | 2415 return _array.subByteArray(_offset + start, length); |
| 2413 } | 2416 } |
| 2414 | 2417 |
| 2415 static const int _BYTES_PER_ELEMENT = 8; | 2418 static const int _BYTES_PER_ELEMENT = 8; |
| 2416 final ByteArray _array; | 2419 final ByteArray _array; |
| 2417 final int _offset; | 2420 final int _offset; |
| 2418 final int _length; | 2421 final int _length; |
| 2419 } | 2422 } |
| OLD | NEW |