Permalink
Browse files

Slay some cyclopes

  • Loading branch information...
deadmoose committed Oct 15, 2011
1 parent 959ed91 commit 7a0e2f03ef1c0090a662331e94e73c254a0dd76a
@@ -295,10 +295,10 @@ public class ColorMatrix
public function blend (mat :ColorMatrix, amount :Number) :ColorMatrix
{
var inv_amount :Number = (1 - amount);
- var i :int = 0;
- while (i < 20) {
- matrix[i] = ((inv_amount * Number(matrix[i])) + (amount * Number(mat.matrix[i])));
- i++;
+ var ii :int = 0;
+ while (ii < 20) {
+ matrix[ii] = ((inv_amount * Number(matrix[ii])) + (amount * Number(mat.matrix[ii])));
+ ii++;
};
return this;
@@ -238,11 +238,11 @@ public class Arrays
/**
* Swap the elements in the specified positions in the specified list.
*/
- public static function swap (arr :Array, i :int, j :int) :void
+ public static function swap (arr :Array, ii :int, jj :int) :void
{
- var tmp :Object = arr[i];
- arr[i] = arr[j];
- arr[j] = tmp;
+ var tmp :Object = arr[ii];
+ arr[ii] = arr[jj];
+ arr[jj] = tmp;
}
/**
@@ -400,9 +400,9 @@ public class Arrays
*/
public static function splice (arr :Array, index :int, deleteCount :int, insertions :Array = null) :Array
{
- var i :Array = (insertions == null) ? [] : insertions.concat(); // don't modify insertions
- i.unshift(index, deleteCount);
- return arr.splice.apply(arr, i);
+ var ii :Array = (insertions == null) ? [] : insertions.concat(); // don't modify insertions
+ ii.unshift(index, deleteCount);
+ return arr.splice.apply(arr, ii);
}
/**
@@ -46,8 +46,8 @@ public class RingBuffer
var newArray :Array = new Array();
var newLength :uint = Math.min(_length, newCapacity);
newArray.length = newCapacity;
- for (var i :uint = 0; i < newLength; ++i) {
- newArray[i] = this.at(i);
+ for (var ii :uint = 0; ii < newLength; ++ii) {
+ newArray[ii] = this.at(ii);
}
_capacity = newCapacity;
@@ -77,9 +77,9 @@ public class RingBuffer
*/
public function unshift (...args) :uint
{
- for (var i :int = args.length - 1; i >= 0; --i) {
+ for (var ii :int = args.length - 1; ii >= 0; --ii) {
var index :uint = (_firstIndex > 0 ? _firstIndex - 1 : _capacity - 1);
- _array[index] = args[i];
+ _array[index] = args[ii];
_length = Math.min(_length + 1, _capacity);
_firstIndex = index;
}
@@ -96,9 +96,9 @@ public class RingBuffer
*/
public function push (...args) :uint
{
- for (var i :uint = 0; i < args.length; ++i) {
+ for (var ii :uint = 0; ii < args.length; ++ii) {
var index :uint = ((_firstIndex + _length) % _capacity);
- _array[index] = args[i];
+ _array[index] = args[ii];
_length = Math.min(_length + 1, _capacity);
// did we overwrite the first index?
@@ -180,8 +180,8 @@ public class RingBuffer
*/
public function every (callback :Function, thisObject :* = null) :Boolean
{
- for (var i :int = 0; i < _length; ++i) {
- if (!callback.call(thisObject, this.at(i))) {
+ for (var ii :int = 0; ii < _length; ++ii) {
+ if (!callback.call(thisObject, this.at(ii))) {
return false;
}
}
@@ -194,8 +194,8 @@ public class RingBuffer
*/
public function forEach (callback :Function, thisObject :* = null) :void
{
- for (var i :int = 0; i < _length; ++i) {
- callback.call(thisObject, this.at(i));
+ for (var ii :int = 0; ii < _length; ++ii) {
+ callback.call(thisObject, this.at(ii));
}
}
@@ -206,9 +206,9 @@ public class RingBuffer
*/
public function indexOf (searchElement :*, fromIndex :int = 0) :int
{
- for (var i :int = 0; i < _length; ++i) {
- if (this.at(i) === searchElement) {
- return i;
+ for (var ii :int = 0; ii < _length; ++ii) {
+ if (this.at(ii) === searchElement) {
+ return ii;
}
}
@@ -220,9 +220,9 @@ public class TimeBuffer
*/
public function indexOf (searchElement :*, fromIndex :int = 0) :int
{
- for (var i :int = 0; i < _length; ++i) {
- if (at(i) === searchElement) {
- return i;
+ for (var ii :int = 0; ii < _length; ++ii) {
+ if (at(ii) === searchElement) {
+ return ii;
}
}

0 comments on commit 7a0e2f0

Please sign in to comment.