diff options
author | Rich Hickey <richhickey@gmail.com> | 2006-07-28 18:51:47 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2006-07-28 18:51:47 +0000 |
commit | 709e897e44e353f2bda74d1f5b4bcaf413bf5a54 (patch) | |
tree | c948320ce2574b99495421c2f91ea50b50e0aa1d /src/cli/runtime/PersistentHashtableMap.cs | |
parent | f6beae41f544340607bddb4a217abd249d085fc6 (diff) |
derived from Obj
Diffstat (limited to 'src/cli/runtime/PersistentHashtableMap.cs')
-rw-r--r-- | src/cli/runtime/PersistentHashtableMap.cs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/cli/runtime/PersistentHashtableMap.cs b/src/cli/runtime/PersistentHashtableMap.cs index 51759d25..520bb05a 100644 --- a/src/cli/runtime/PersistentHashtableMap.cs +++ b/src/cli/runtime/PersistentHashtableMap.cs @@ -16,7 +16,7 @@ namespace clojure.lang {
-public class PersistentHashtableMap : IPersistentMap {
+public class PersistentHashtableMap : Obj, IPersistentMap {
static readonly float FILL_FACTOR = 0.75f;
@@ -57,6 +57,13 @@ internal PersistentHashtableMap(int count,PersistentArray array,int growAt) { this.growAtCount = growAt;
}
+public override Obj withMeta(IPersistentMap meta)
+ {
+ Obj ret = (Obj)MemberwiseClone();
+ ret._meta = meta;
+ return ret;
+ }
+
int calcPrimeCapacity(int capacity) {
// No .Net equivalent
//return BigInteger.valueOf((long) (capacity/FILL_FACTOR)).nextProbablePrime().intValue();
@@ -264,16 +271,22 @@ static int bucketFor(Object key, PersistentArray array) { }
virtual internal IPersistentMap create(int capacity) {
- return new PersistentHashtableMap(capacity);
+ PersistentHashtableMap ret = new PersistentHashtableMap(capacity);
+ ret._meta = _meta;
+ return ret;
}
virtual internal IPersistentMap create(int count,PersistentArray array) {
- return new PersistentHashtableMap(count, array);
-}
+ PersistentHashtableMap ret = new PersistentHashtableMap(count, array);
+ ret._meta = _meta;
+ return ret;
+ }
virtual internal IPersistentMap create(int i, PersistentArray newArray, int growAtCount){
- return new PersistentHashtableMap(i, newArray, growAtCount);
-}
+ PersistentHashtableMap ret = new PersistentHashtableMap(i, newArray, growAtCount);
+ ret._meta = _meta;
+ return ret;
+ }
virtual internal IPersistentMap createListMap(Object key, Object val){
|