PERWAPI.CILInstructions.RemoveInstructions C# (CSharp) Method

RemoveInstructions() public method

Remove the instructions from position "startRange" to (and including) position "endRange" from the buffer. If the range removed contains the "current" instruction (from GetNext or GetPrev) then the "current" instruction becomes the instruction before startRange in the buffer.
public RemoveInstructions ( int startRange, int endRange ) : void
startRange int
endRange int
return void
        public void RemoveInstructions(int startRange, int endRange)
        {
            if (startRange < 0) startRange = 0;
            if (endRange >= tide-1) {// cut to startRange
                tide = startRange;
                return;
            }
            int offset = endRange-startRange+1;
            for (int i=endRange+1; i < tide; i++) {
                buffer[i-offset] = buffer[i];
                buffer[i-offset].index = (uint)(i-offset);
            }
            tide -= offset;
            if ((currI >= startRange) && (currI <= endRange)) currI = startRange-1;
        }