Might as well use a different signifier in case people do want to use

negative indices.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4846 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2007-10-18 18:01:49 +00:00
parent 924a8a319d
commit 8c4776a3f0
@@ -33,9 +33,9 @@ public class StreamableArrayList
_array = (values == null) ? new Array() : values;
}
public function add (item :Object, index :int = -1) :Boolean
public function add (item :Object, index :int = int.MAX_VALUE) :Boolean
{
_array.splice((index == -1) ? _array.length : index, 0, item);
_array.splice(Math.min(_array.length, index), 0, item);
return true;
}
@@ -44,12 +44,12 @@ public class StreamableArrayList
*
* @param otherList may be another StreamableArrayList or an Array
*/
public function addAll (otherList :*, index :int = -1) :Boolean
public function addAll (otherList :*, index :int = int.MAX_VALUE) :Boolean
{
var other :Array = getArray(otherList);
// splice the array in at the index
_array.splice((index == -1) ? _array.length : index, 0, other);
_array.splice(Math.min(_array.length, index), 0, other);
return (other.length > 0);
}