internal virtual ArrayObject Unshift(Object[] args)
{
Debug.PreCondition(args != null && args.Length > 0);
uint oldLength = this.len;
int numArgs = args.Length;
ulong newLength = oldLength + (ulong)numArgs;
this.SetLength(newLength);
if (newLength <= this.denseArrayLength)
{
for (int i = (int)(oldLength - 1); i >= 0; i--)
{
this.denseArray[i + numArgs] = this.denseArray[i];
}
ArrayObject.Copy(args, 0, this.denseArray, 0, args.Length);
}
else
{
for (long i = oldLength - 1; i >= 0; i--)
{
this.SetValueAtIndex((uint)(i + numArgs), this.GetValueAtIndex((uint)i));
}
for (uint i = 0; i < numArgs; i++)
{
this.SetValueAtIndex(i, args[i]);
}
}
return(this);
}