internal virtual void Sort(ScriptFunction compareFn)
        {
            QuickSort qs     = new QuickSort(this, compareFn);
            uint      length = this.len;

            if (length <= this.denseArrayLength)
            {
                qs.SortArray(0, (int)length - 1);
            }
            else
            {
                qs.SortObject(0, length - 1);
            }
        }
        internal virtual void Sort(ScriptFunction compareFn)
        {
            QuickSort sort = new QuickSort(this, compareFn);
            uint      len  = this.len;

            if (len <= this.denseArrayLength)
            {
                sort.SortArray(0, ((int)len) - 1);
            }
            else
            {
                sort.SortObject(0L, (long)(len - 1));
            }
        }
        public static Object sort(Object thisob, Object function)
        {
            ScriptFunction func = null;

            if (function is ScriptFunction)
            {
                func = (ScriptFunction)function;
            }
            uint length = Convert.ToUint32(LateBinding.GetMemberValue(thisob, "length"));

            if (thisob is ArrayObject)
            {
                ((ArrayObject)thisob).Sort(func);
            }
            else if (length <= Int32.MaxValue)
            {
                QuickSort qs = new QuickSort(thisob, func);
                qs.SortObject(0, length);
            }
            return(thisob);
        }
Exemplo n.º 4
0
 internal virtual void Sort(ScriptFunction compareFn){
   QuickSort qs = new QuickSort(this, compareFn);
   uint length = this.len;
   if (length <= this.denseArrayLength)
     qs.SortArray(0, (int)length - 1);
   else
     qs.SortObject(0, length - 1);
 }
 internal virtual void Sort(ScriptFunction compareFn)
 {
     QuickSort sort = new QuickSort(this, compareFn);
     uint len = this.len;
     if (len <= this.denseArrayLength)
     {
         sort.SortArray(0, ((int) len) - 1);
     }
     else
     {
         sort.SortObject(0L, (long) (len - 1));
     }
 }
 public static Object sort(Object thisob, Object function){
   ScriptFunction func = null;
   if (function is ScriptFunction)
     func = (ScriptFunction)function;
   uint length = Convert.ToUint32(LateBinding.GetMemberValue(thisob, "length"));
   if (thisob is ArrayObject)
     ((ArrayObject)thisob).Sort(func);
   else if (length <= Int32.MaxValue){
     QuickSort qs = new QuickSort(thisob, func);
     qs.SortObject(0, length);
   }
   return thisob;
 }