summaryrefslogtreecommitdiff
path: root/Source/Core/PureCollections.cs
diff options
context:
space:
mode:
authorGravatar Ally Donaldson <unknown>2013-07-22 18:05:27 +0100
committerGravatar Ally Donaldson <unknown>2013-07-22 18:05:27 +0100
commitafaeb081ffcc1c258db6eb7c34ba0b04c493919a (patch)
treed0b07c3e3082f323e17523a3e695dc18ee61062d /Source/Core/PureCollections.cs
parent858d43ff93a0cc9bc30ce55906499fb9157124c9 (diff)
More refactoring towards replacing PureCollections.Sequence with List
Diffstat (limited to 'Source/Core/PureCollections.cs')
-rw-r--r--Source/Core/PureCollections.cs38
1 files changed, 2 insertions, 36 deletions
diff --git a/Source/Core/PureCollections.cs b/Source/Core/PureCollections.cs
index 58b6e9c0..8eafd73f 100644
--- a/Source/Core/PureCollections.cs
+++ b/Source/Core/PureCollections.cs
@@ -520,7 +520,7 @@ namespace PureCollections {
public bool MoveNext() {
index++;
//while (index < seq.elems.Length); // Sequences allow nils ... && seq.elems[index] == null);
- return index < seq.Length;
+ return index < seq.Count;
}
public object Current {
get {
@@ -594,7 +594,7 @@ namespace PureCollections {
}
//In place Update (and Remove) and Length - - - - - - - - - - - - - - -
- public int Length {
+ public int Count {
get {
return this.card;
}
@@ -634,40 +634,6 @@ namespace PureCollections {
}
}
- public void Remove() {
- if (card == 0)
- return;
- card--;
- }
-
- // remove the first occurrence of o from this sequence
- public void Remove(Object x) {
- if (x == null)
- throw new MissingCase();
- Contract.Assert(this.elems != null);
- for (int i = 0; i < card; i++) {
- if (x.Equals(elems[i])) {
- ++i;
- while (i < card) {
- elems[i - 1] = elems[i];
- ++i;
- }
- card--;
- elems[card] = null;
- return;
- }
- }
- }
-
- public void Truncate(int newLen) {
- Contract.Requires(0 <= newLen && newLen <= Length);
- Contract.Assert(elems != null);
- for (int i = newLen; i < card; i++) {
- elems[i] = null;
- }
- card = newLen;
- }
-
//ToString - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[Pure]
public override string ToString() {