private void copySourceInstructions(int offset, int limit, int targetOffset, SVNDiffWindow window, SVNDiffInstruction[] windowInsructions) {
int firstInstuctionIndex = findInstructionIndex(myOffsetsIndex, offset);
int lastInstuctionIndex = findInstructionIndex(myOffsetsIndex, limit - 1);
for(int i = firstInstuctionIndex; i <= lastInstuctionIndex; i++) {
SVNDiffInstruction instruction = windowInsructions[i];
int off0 = myOffsetsIndex.offsets[i];
int off1 = myOffsetsIndex.offsets[i + 1];
int fix_offset = offset > off0 ? offset - off0 : 0;
int fix_limit = off1 > limit ? off1 - limit : 0;
SVNDebugLog.assertCondition(SVNLogType.DEFAULT, fix_offset + fix_limit < instruction.length,
"assert #7");
if (instruction.type != SVNDiffInstruction.COPY_FROM_TARGET) {
int oldOffset = instruction.offset;
int oldLength = instruction.length;
instruction.offset += fix_offset;
instruction.length = oldLength - fix_offset - fix_limit;
myNextWindowInstructions = ensureBufferSize(myNextWindowInstructions, 10);
instruction.writeTo(myNextWindowInstructions);
if (instruction.type == SVNDiffInstruction.COPY_FROM_NEW_DATA) {
myNextWindowData = ensureBufferSize(myNextWindowData, instruction.length);
window.writeNewData(myNextWindowData, instruction.offset, instruction.length);
}
instruction.offset = oldOffset;