Added out-of-sync check for the Deque enumerator; added unit test for the out-of-sync check
git-svn-id: file:///srv/devel/repo-conversion/nusu@166 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
a56da772d4
commit
9ec6546f70
5 changed files with 65 additions and 2 deletions
|
|
@ -38,6 +38,9 @@ namespace Nuclex.Support.Collections {
|
|||
|
||||
this.blocks[0][this.firstBlockStartIndex] = item;
|
||||
++this.count;
|
||||
#if DEBUG
|
||||
++this.version;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>Appends an item to the end of the double-ended queue</summary>
|
||||
|
|
@ -52,6 +55,9 @@ namespace Nuclex.Support.Collections {
|
|||
|
||||
this.blocks[this.blocks.Count - 1][this.lastBlockEndIndex - 1] = item;
|
||||
++this.count;
|
||||
#if DEBUG
|
||||
++this.version;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>Inserts the item at the specified index</summary>
|
||||
|
|
@ -64,6 +70,9 @@ namespace Nuclex.Support.Collections {
|
|||
} else { // Nope, we're closer to the right end
|
||||
shiftRightAndInsert(index, item);
|
||||
}
|
||||
#if DEBUG
|
||||
++this.version;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue