diff --git a/src/as/com/threerings/util/ArrayUtil.as b/src/as/com/threerings/util/ArrayUtil.as index b975a5807..4fc97f69e 100644 --- a/src/as/com/threerings/util/ArrayUtil.as +++ b/src/as/com/threerings/util/ArrayUtil.as @@ -30,6 +30,21 @@ package com.threerings.util { */ public class ArrayUtil { + /** + * Creates a new Array and fills it with a default value. + * @param size the size of the array + * @param val the value to store at each index of the Array + */ + public static function create (size :uint, val :* = null) :Array + { + var arr :Array = new Array(size); + for (var ii :uint = 0; ii < size; ii++) { + arr[ii] = val; + } + + return arr; + } + /** * Creates a shallow copy of the array. *