Skip to content

Commit 61ad442

Browse files
author
Vance Morrison
authored
Merge pull request microsoft#881 from mpeyrotc/fix_copy
Remove destructive behavior from copy
2 parents 7eb6455 + 0157082 commit 61ad442

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/FastSerialization/SegmentedList.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class SegmentedList<T> : ICollection<T>, IReadOnlyList<T>
3636
private int capacity;
3737
private int count;
3838
private T[][] items;
39-
private int lastSegmentRead = 0;
4039

4140
/// <summary>
4241
/// Constructs SegmentedList.
@@ -437,12 +436,6 @@ public void CopyRangeTo(T[] array, int arrayIndex, int startIndex, int endIndex)
437436
remain -= len;
438437
arrayIndex += (int)len;
439438
segmentStartIndex = 0;
440-
441-
if (i != lastSegmentRead)
442-
{
443-
this.items[lastSegmentRead] = null;
444-
lastSegmentRead = i;
445-
}
446439
}
447440
}
448441

@@ -475,7 +468,6 @@ public void Clear()
475468
items = null;
476469
count = 0;
477470
capacity = 0;
478-
lastSegmentRead = 0;
479471
}
480472

481473
/// <summary>
@@ -543,12 +535,6 @@ private void AddRoomForElement(int index)
543535
}
544536
}
545537

546-
public void ClearSegment()
547-
{
548-
this.items[lastSegmentRead] = null;
549-
lastSegmentRead++;
550-
}
551-
552538
/// <summary>
553539
/// Shifts the tail of the list to remove the element.
554540
/// </summary>

0 commit comments

Comments
 (0)