unsafe private void Remove(int startIndex, int count, out Repro_ReplaceAll chunk, int indexInChunk) { Contract.Requires(startIndex >= 0); Contract.Requires(count >= 0); int endIndex = startIndex + count; chunk = this; Repro_ReplaceAll endChunk = null; int endIndexInChunk = 0; for (; ;) { if (endIndex - chunk.m_ChunkOffset >= 0) { // if (endChunk == null) { endChunk = chunk; endIndexInChunk = endIndex - endChunk.m_ChunkOffset; Contract.Assert(endIndexInChunk >= 0); } } else { chunk.m_ChunkOffset -= count; } chunk = chunk.m_ChunkPrevious; } // Contract.Assert(endIndexInChunk >= 0); }
unsafe private void Remove(int startIndex, int count, out Repro_ReplaceAll chunk, int indexInChunk) { Contract.Requires(startIndex >= 0); Contract.Requires(count >= 0); int endIndex = startIndex + count; chunk = this; Repro_ReplaceAll endChunk = null; int endIndexInChunk = 0; for (; ; ) { if (endIndex - chunk.m_ChunkOffset >= 0) { // if (endChunk == null) { endChunk = chunk; endIndexInChunk = endIndex - endChunk.m_ChunkOffset; Contract.Assert(endIndexInChunk >= 0); } } else { chunk.m_ChunkOffset -= count; } chunk = chunk.m_ChunkPrevious; } // Contract.Assert(endIndexInChunk >= 0); }