Skip to content

Commit

Permalink
typoes in DList doc/unittest comments
Browse files Browse the repository at this point in the history
  • Loading branch information
monarchdodra committed Oct 31, 2012
1 parent 69d3a93 commit 229aa26
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions std/container.d
Expand Up @@ -1528,23 +1528,23 @@ b.stableInsertFront(1); //insert before of b
b.stableInsertBack(5); //insert after of b
// (2 - (3 - 4) - 5)
assert(a[].equal([3, 4])); //a is not changed
assert(b[].equal([1, 3, 4, 5])); // but a is
assert(b[].equal([1, 3, 4, 5])); // but b is changed
a.stableInsertFront(2); //insert in front of a, this will insert "inside" the chain
// (1 - (2 - 3 - 4) - 5)
assert(a[].equal([2, 3, 4])); //a is modified
assert(b[].equal([1, 2, 3, 4, 5])); //and so is b;
a.remove(a[]); //remove all the elements of a;
a.remove(a[]); //remove all the elements of a: This will cut them from the chain;
// (1 - 5)
assert(a[].empty); //a is empty
assert(b[].equal([1, 5])); //b has lost some of its elements;
a.insert(2); //insert in a. This will create a new chain
// (2)
// (1 - 5)
assert(a[].equal([2])); //a is empty
assert(b[].equal([1, 5])); //b has lost some of its elements;
assert(a[].equal([2])); //a is a new chain
assert(b[].equal([1, 5])); //b is unchanged;
----
*/
struct DList(T)
Expand Down Expand Up @@ -2233,23 +2233,23 @@ unittest
b.stableInsertBack(5); //insert after of b
// (2 - (3 - 4) - 5)
assert(a[].equal([3, 4])); //a is not changed
assert(b[].equal([1, 3, 4, 5])); // but a is
assert(b[].equal([1, 3, 4, 5])); // but b is changed

a.stableInsertFront(2); //insert in front of a, this will insert "inside" the chain
// (1 - (2 - 3 - 4) - 5)
assert(a[].equal([2, 3, 4])); //a is modified
assert(b[].equal([1, 2, 3, 4, 5])); //and so is b;

a.remove(a[]); //remove all the elements of a;
a.remove(a[]); //remove all the elements of a: This will cut them from the chain;
// (1 - 5)
assert(a[].empty); //a is empty
assert(b[].equal([1, 5])); //b has lost some of its elements;

a.insert(2); //insert in a. This will create a new chain
// (2)
// (1 - 5)
assert(a[].equal([2])); //a is empty
assert(b[].equal([1, 5])); //b has lost some of its elements;
assert(a[].equal([2])); //a is a new chain
assert(b[].equal([1, 5])); //b is unchanged;
}

unittest
Expand Down

0 comments on commit 229aa26

Please sign in to comment.