diff --git a/src/as/com/threerings/util/ArrayUtil.as b/src/as/com/threerings/util/ArrayUtil.as index e2cf2b9df..c1093b8df 100644 --- a/src/as/com/threerings/util/ArrayUtil.as +++ b/src/as/com/threerings/util/ArrayUtil.as @@ -228,6 +228,14 @@ public class ArrayUtil return true; } + /** + * Copy a segment of one array to another. + * @param src the array to copy from + * @param srcoffset the position in the source array to begin copying from + * @param dst the array to copy into + * @param dstoffset the position in the destition array to begin copying into + * @param count the number of elements to copy + */ public static function copy ( src :Array, srcoffset :uint, dst :Array, dstoffset :uint, count :uint) :void { diff --git a/src/as/com/threerings/util/Throttle.as b/src/as/com/threerings/util/Throttle.as index 48857fbb2..082c4e333 100644 --- a/src/as/com/threerings/util/Throttle.as +++ b/src/as/com/threerings/util/Throttle.as @@ -83,6 +83,7 @@ public class Throttle // copy to a larger buffer, leaving zeroes at the beginning oldestOp = _oldestOp + operations - _ops.length; ArrayUtil.copy(_ops, 0, ops, 0, _oldestOp); + ArrayUtil.copy(_ops, _oldestOp, ops, oldestOp, _ops.length - _oldestOp); } else if (operations < _ops.length) { // copy to a smaller buffer, truncating older operations