void (int startLongIndex, int endLongIndex) { checkUpdateParameters(startLongIndex, endLongIndex); int startSumIndex = getRelevantSumIndex(startLongIndex); int endSumIndex = getRelevantSumIndex(endLongIndex); int prevEndSum = mySubSumOfBlocks[endSumIndex]; for (int blockIndex = startSumIndex; blockIndex <= endSumIndex; blockIndex++) { int endIndex = Math.min(myLongSize, (blockIndex + 1) * myBlockSize); mySubSumOfBlocks[blockIndex] = calculateSumForBlock(blockIndex, endIndex - 1); } int sumDelta = mySubSumOfBlocks[endSumIndex] - prevEndSum; for (int blockIndex = endSumIndex + 1; blockIndex < mySubSumOfBlocks.length; blockIndex++) { mySubSumOfBlocks[blockIndex] += sumDelta; } }