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

Unified Diff: runtime/lib/simd128.dart

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 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
Index: runtime/lib/simd128.dart
diff --git a/runtime/lib/simd128.dart b/runtime/lib/simd128.dart
index 5052773eec736d41c71b83bca8356d4dc9e0c25c..ca3f587370b31da0bc00b64a96de3b031ee69be2 100644
--- a/runtime/lib/simd128.dart
+++ b/runtime/lib/simd128.dart
@@ -583,6 +583,7 @@ class _Float32x4Array extends _ByteArrayBase
factory _Float32x4Array(int length) {
return _new(length);
}
+
Ivan Posva 2013/03/18 03:17:39 Why are you changing white space here?
factory _Float32x4Array.view(ByteArray array,
[int start = 0, int length]) {
if (length == null) {
@@ -590,21 +591,32 @@ class _Float32x4Array extends _ByteArrayBase
}
return new _Float32x4ArrayView(array, start, length);
}
+
Float32x4 operator [](int index) {
return _getIndexed(index);
}
+
int operator []=(int index, Float32x4 value) {
_setIndexed(index, value);
}
+
Iterator<Float32x4> get iterator {
return new _ByteArrayIterator<Float32x4>(this);
}
- List<Float32x4> getRange(int start, int length) {
+
+ List<Float32x4> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ int length = end - start;
_rangeCheck(this.length, start, length);
List<Float32x4> result = _new(length);
result.setRange(0, length, this, start);
return result;
}
+
+ List<Float32x4> getRange(int start, int length) {
+ return sublist(start, start + length);
+ }
+
void setRange(int start, int length, List<Float32x4> from,
[int startFrom = 0]) {
if (from is _Float32x4Array) {
@@ -667,13 +679,19 @@ class _Float32x4ArrayView extends _ByteArrayViewBase
return new _ByteArrayIterator<Float32x4>(this);
}
- List<Float32x4> getRange(int start, int length) {
+ List<Float32x4> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ int length = end - start;
_rangeCheck(this.length, start, length);
List<Float32x4> result = new Float32List(length);
result.setRange(0, length, this, start);
return result;
}
+ List<Float32x4> getRange(int start, int length) {
+ return sublist(start, start + length);
+ }
+
void setRange(int start, int length, List<Float32x4> from,
[int startFrom = 0]) {
IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom);
@@ -717,13 +735,19 @@ class _ExternalFloat32x4Array extends _ByteArrayBase
return new _ByteArrayIterator<Float32x4>(this);
}
- List<Float32x4> getRange(int start, int length) {
+ List<Float32x4> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ int length = end - start;
_rangeCheck(this.length, start, length);
List<Float32x4> result = new Float32x4List(length);
result.setRange(0, length, this, start);
return result;
}
+ List<Float32x4> getRange(int start, int length) {
+ return sublist(start, start + length);
+ }
+
void setRange(int start, int length, List<Float32x4> from,
[int startFrom = 0]) {
if (from is _ExternalFloat32x4Array) {

Powered by Google App Engine
This is Rietveld 408576698