From ed002196b0351aad3647b0e1a431662ba323900d Mon Sep 17 00:00:00 2001 From: Jamie Doornbos Date: Tue, 4 Nov 2008 08:33:05 +0000 Subject: [PATCH] Missed a line from the previous change. Added comment for new ArrayUtil method git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5498 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/ArrayUtil.as | 8 ++++++++ src/as/com/threerings/util/Throttle.as | 1 + 2 files changed, 9 insertions(+) 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