Reverses the order of all elements in the given interval.

@param arr array
@param pos position of first element of the interval
@param len length of the interval
184234
public static void reverse(final Object[] arr, final int pos, final int len) {
        for (int l = pos, r = pos + len - 1; l < r; l++, r--) {
            final Object tmp = arr[l];
            arr[l] = arr[r];
            arr[r] = tmp;
        }
    }
350507
function positionAfter (arr, prevChild) {
    var idx
    if (prevChild === null) {
      return 0
    } else {
      idx = findIndex(arr, prevChild)
      return (idx === -1) ? arr.length : idx + 1
    }
  }
277117
def pos_to_block(pos, len)
      start_block, start_byte = pos.divmod(@sb.block_size)
      end_block, _end_byte = (pos + len - 1).divmod(@sb.block_size)
      nblocks = end_block - start_block + 1
      return start_block, start_byte, nblocks
    end
9691
function reverseArray(array) {
  let index = array.length,
      newArray = [];

  while (index--) {
    newArray.push(array[index]);
  }

  return newArray;
}
989108
function (arrArg) {
    return arrArg.filter(function (elem, pos, arr) {
        return arr.indexOf(elem) === pos;
    });
}
784370
private void scanFraction(int pos) {
        skipIllegalUnderscores();
        if ('0' <= reader.ch && reader.ch <= '9') {
            scanDigits(pos, 10);
        }
        int sp1 = reader.sp;
        if (reader.ch == 'e' || reader.ch == 'E') {
            reader.putChar(true);
            skipIllegalUnderscores();
            if (reader.ch == '+' || reader.ch == '-') {
                reader.putChar(true);
            }
            skipIllegalUnderscores();
            if ('0' <= reader.ch && reader.ch <= '9') {
                scanDigits(pos, 10);
                return;
            }
            lexError(pos, "malformed.fp.lit");
            reader.sp = sp1;
        }
    }
138823
public function isArrayValueSet($pos, $arr)
    {
        if (is_array($arr) && array_key_exists($pos, $arr) && !empty($arr[$pos])) {
            return true;
        }
    }
373015
public boolean position(long pos)
    throws IOException
  {
    if (pos < 0) {
      // Return error on seek to negative stream position

      return false;
    }
    
    long delta = pos - position();
    
    long newOffset = _readOffset + delta;
    
    if (newOffset >= 0 && newOffset < _readLength) {
      _readOffset = (int) newOffset;
      
      return true;
    }
    
    if (delta < 0) {
      // Seek backwards in the stream

      _position = pos;
      _readLength = _readOffset = 0;

      if (_source != null) {
        _source.seekStart(pos);

        return true;
      }
      else {
        return false;
      }
    }
    else {
      // Seek forward in the stream, skip any buffered bytes

      long n = pos - position();

      return (skip(n) == n);
    }
  }
382519
function reverseInplace(array) {
  for (var i = 0; i < array.length / 2; ++i) {
    var h = array[i];
    var ii = array.length - i - 1;
    array[i] = array[ii];
    array[ii] = h;
  }
}
463056
public static void reverse(final char[] a, int fromIndex, int toIndex) {
        checkFromToIndex(fromIndex, toIndex, len(a));

        if (N.isNullOrEmpty(a) || a.length == 1) {
            return;
        }

        char tmp = 0;

        for (int i = fromIndex, j = toIndex - 1; i < j; i++, j--) {
            tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }
    }
327543
public void reverse() {
	// overridden for performance only.
	double tmp;
	int limit=size/2;
	int j=size-1;

	double[] theElements = elements;
	for (int i=0; i<limit;) { //swap
		tmp=theElements[i];
		theElements[i++]=theElements[j];
		theElements[j--]=tmp;
	}
}
812807
function (pos) {
            if (pos === undefined) {
                pos = this.position;
            }
            var lines = this.source.substring(0, pos).split(/\r?\n/),
                row = lines.length,
                col = lines.pop().length + 1,
                allLines = this.source.split(/\r?\n/),
                source = [];
            for (var i = -2; i < 2; i++) {
                if (allLines[row + i]) {
                    source.push({
                        row: row + i + 1,
                        code: allLines[row + i]
                    })
                }
            }
            return {
                row: row,
                col: col,
                source: source
            }
        }
1144530
public static void sort(long[] longArray) {
        int index = 0;
        long value = 0;
        
        for(int i = 1; i < longArray.length; i++) {
            index = i;
            value = longArray[index];
            
            while(index > 0 && value < longArray[index - 1]) {
                longArray[index] = longArray[index - 1];
                
                index--;
            }
            
            longArray[index] = value;
        }
    }
1168642
public void seek(long pos) throws IOException
    {
        long inSegmentPos = pos - segmentOffset;
        if (inSegmentPos < 0 || inSegmentPos > buffer.capacity())
            throw new IOException(String.format("Seek position %d is not within mmap segment (seg offs: %d, length: %d)", pos, segmentOffset, buffer.capacity()));

        seekInternal((int) inSegmentPos);
    }
311367
protected void moveUp(int pos)
  {
//    if (tc.isEntryEnabled())
//      SibTr.entry(tc, "moveUp", new Integer(pos));

    PriorityQueueNode node = elements[pos];
    long priority = node.priority;

    while ((pos > 0) && (elements[parent(pos)].priority > priority))
    {
      setElement(elements[parent(pos)], pos);
      pos = parent(pos);
    }

    setElement(node, pos);

//    if (tc.isEntryEnabled())
//      SibTr.exit(tc, "moveUp");
  }
715967
public static <T> void reverse(final T array) {

        if (ArrayUtils.isArray(array)) {
            int mlength = Array.getLength(array) - 1;
            Object temp = null;
            for (int i = 0, j = mlength; i < mlength; i++, j--) {
                Object arg0 = Array.get(array, i);
                Object arg1 = Array.get(array, j);
                temp = arg0;
                Array.set(array, i, arg1);
                Array.set(array, j, temp);
            }
        }
    }
554138
public static void sort(short[] shortArray) {
        int index = 0;
        short value = 0;
        
        for(int i = 1; i < shortArray.length; i++) {
            index = i;
            value = shortArray[index];
            
            while(index > 0 && value < shortArray[index - 1]) {
                shortArray[index] = shortArray[index - 1];
                
                index--;
            }
            
            shortArray[index] = value;
        }
    }