diff options
author | Rich Hickey <richhickey@gmail.com> | 2006-08-09 14:45:16 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2006-08-09 14:45:16 +0000 |
commit | b9b9ceb459f528347f2433357697370fa3fa67b4 (patch) | |
tree | 0ebad3922bec9d4ec43d2d3c4ae372d53a204ea1 /src/cli/runtime/PersistentArrayMap.cs | |
parent | be12a746746c53c1f00758df7daa1fa5edc03935 (diff) |
made seq.count constant-time
Diffstat (limited to 'src/cli/runtime/PersistentArrayMap.cs')
-rw-r--r-- | src/cli/runtime/PersistentArrayMap.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cli/runtime/PersistentArrayMap.cs b/src/cli/runtime/PersistentArrayMap.cs index f4e9e6ee..8ffaca76 100644 --- a/src/cli/runtime/PersistentArrayMap.cs +++ b/src/cli/runtime/PersistentArrayMap.cs @@ -208,6 +208,9 @@ internal class Seq : ASeq, IMapEntry{ return new Seq(array, i + 2);
return null;
}
+ override public int count() {
+ return (array.Length - i)/2;
+ }
}
internal class Iter : IEnumerator,IMapEntry{
Object[] array;
|