arrays.js
function getWithLength(length) {
  var arrays = pool[length];
  var array;
  var i;

  // Create the first array for the specified length
  if (!arrays) {
    array = create(length);
  }

  // Find an unused array among the created arrays for the specified length
  if (!array) {
    for (i = arrays.length; i--;) {
      if (!arrays[i].inUse) {
        array = arrays[i];
        break;
      }
    }

    // If no array was found, create a new one
    if (!array) {
      array = create(length);
    }
  }

  array.inUse = true;
  return array;
}
function getWithLength(length) {
  var arrays = pool[length];
  var array;
  var i;

  // Create the first array for the specified length
  if (!arrays) {
    array = create(length);
  }

  // Find an unused array among the created arrays for the specified length
  if (!array) {
    for (i = arrays.length; i--;) {
      if (!arrays[i].inUse) {
        array = arrays[i];
        break;
      }
    }

    // If no array was found, create a new one
    if (!array) {
      array = create(length);
    }
  }

  array.inUse = true;
  return array;
}
function getWithLength ( length ) { var arrays = pool [ length ] ; var array ; var i ; // Create the first array for the specified length if ( ! arrays ) { array = create ( length ) ; } // Find an unused array among the created arrays for the specified length if ( ! array ) { for ( i = arrays . length ; i -- ; ) { if ( ! arrays [ i ] . inUse ) { array = arrays [ i ] ; break ; } } // If no array was found, create a new one if ( ! array ) { array = create ( length ) ; } } array . inUse = true ; return array ; }
Get an array with the specified length from the pool.

@param {number} length The preferred length of the array.

@return {Array} An array.
Get an array with the specified length from the pool .