/*	warp index of lacation and first value (exchange)
163202
function swap(sArray, location) {
	location = location % sArray.length;
	var ref = [ sArray[location] , sArray[0] ];
	sArray[0] = ref[0];
	sArray[location] = ref[1];
	return sArray;
}
736120
public int indexOf( byte value ) {
		for (int i = 0; i < size; i++) {
			if( data[i] == value )
				return i;
		}
		return -1;
	}
162459
function elementAt(index, defaultValue) {
  let i = 0;

  for (let item of this) {
    if (i === index) return item;
    i++;
  }

  return defaultValue;
}
539293
private int transactionToIndex(T t) {
		Integer r = allTransactions.absoluteIndexOf(t);
		return r == null ? -1 : r.intValue();
	}
768537
int indexOf(byte[] data, int dataLength, byte[] pattern, int dataOffset) {
        int[] failure = computeFailure(pattern);
        int j = 0;
        if (data.length == 0)
            return -1;
        //final int dataLength = data.length;
        final int patternLength = pattern.length;
        for (int i = dataOffset; i < dataLength; i++) {
            while (j > 0 && pattern[j] != data[i])
                j = failure[j - 1];
            if (pattern[j] == data[i])
                j++;
            if (j == patternLength)
                return i - patternLength + 1;
        }
        return -1;
    }
1179922
private Pair<T, I> indexToPair(int[] i) {
		return new Pair<T, I>(allTransactions.absoluteGet(i[0]), allItems.absoluteGet(i[1]));
	}
470188
function() {

		var binding = this.binding;

		var buffer = this.buffer,
			stride = this.valueSize,

			originalValueOffset = stride * 3;

		binding.getValue( buffer, originalValueOffset );

		// accu[0..1] := orig -- initially detect changes against the original
		for ( var i = stride, e = originalValueOffset; i !== e; ++ i ) {

			buffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];

		}

		this.cumulativeWeight = 0;

	}
1005283
function setValue1f( gl, v ) {

	var cache = this.cache;

	if ( cache[ 0 ] === v ) return;

	gl.uniform1f( this.addr, v );

	cache[ 0 ] = v;

}
813083
int getHalfEdgeUserIndex(int half_edge, int index) {
		int i = getHalfEdgeIndex_(half_edge);
		AttributeStreamOfInt32 stream = m_edgeIndices.get(index);
		if (stream.size() <= i)
			return -1;

		return stream.read(i);
	}
1022840
function indexOf(arr, value, start) {
  start = start || 0;
  if (arr == null) {
    return -1;
  }
  var len = arr.length;
  var i = start < 0 ? len + start : start;
  while (i < len) {
    if (arr[i] === value) {
      return i;
    }
    i++;
  }
  return -1;
}
674759
private int compareShifted(MutableBigInteger b, int ints) {
        int blen = b.intLen;
        int alen = intLen - ints;
        if (alen < blen)
            return -1;
        if (alen > blen)
           return 1;

        // Add Integer.MIN_VALUE to make the comparison act as unsigned integer
        // comparison.
        int[] bval = b.value;
        for (int i = offset, j = b.offset; i < alen + offset; i++, j++) {
            int b1 = value[i] + 0x80000000;
            int b2 = bval[j]  + 0x80000000;
            if (b1 < b2)
                return -1;
            if (b1 > b2)
                return 1;
        }
        return 0;
    }
1318918
public int defineTurnBits(int index, int shift) {
        if (maxTurnCosts == 0)
            return shift;

            // optimization for turn restrictions only
        else if (maxTurnCosts == 1) {
            turnRestrictionBit = 1L << shift;
            return shift + 1;
        }

        int turnBits = Helper.countBitValue(maxTurnCosts);
        turnCostEncoder = new EncodedValueOld("TurnCost", shift, turnBits, 1, 0, maxTurnCosts) {
            // override to avoid expensive Math.round
            @Override
            public final long getValue(long flags) {
                // find value
                flags &= mask;
                flags >>>= shift;
                return flags;
            }
        };
        return shift + turnBits;
    }
1316689
private int indexOf(int key) {
		int startIndex = hashIndex(key);
		int index = startIndex;

		for (;;) {
			if (values[index] == null) {
				// It's available, so no chance that this value exists anywhere in the map.
				return -1;
			}
			if (key == keys[index]) {
				return index;
			}

			// Conflict, keep probing ...
			if ((index = probeNext(index)) == startIndex) {
				return -1;
			}
		}
	}
253650
public int indexOf(final char ch, int startIndex) {
        startIndex = (startIndex < 0 ? 0 : startIndex);
        if (startIndex >= size) {
            return -1;
        }
        final char[] thisBuf = buffer;
        for (int i = startIndex; i < size; i++) {
            if (thisBuf[i] == ch) {
                return i;
            }
        }
        return -1;
    }
276006
void overlayLeftShift(
    int           ix)
  {
    for (int j = ix; j < rightMostIndex(); j++)
      _nodeKey[j] = _nodeKey[j+1];
  }
583812
private long getFirstSecTerForPrimary(int index) {
        long secTer = elements[index];
        if((secTer & SEC_TER_DELTA_FLAG) == 0) {
            // No sec/ter delta.
            return Collation.COMMON_SEC_AND_TER_CE;
        }
        secTer &= ~SEC_TER_DELTA_FLAG;
        if(secTer > Collation.COMMON_SEC_AND_TER_CE) {
            // Implied sec/ter.
            return Collation.COMMON_SEC_AND_TER_CE;
        }
        // Explicit sec/ter below common/common.
        return secTer;
    }
1158369
private int indicesFront(int[] entries) {
    int start = 0;
    for (int i = 0; i < entries.length; i++) {
      start *= numClasses;
      start += entries[i];
    }
    int offset = SloppyMath.intPow(numClasses, windowSize - entries.length);
    start *= offset;
    return start;
  }