diff options
author | Rich Hickey <richhickey@gmail.com> | 2006-07-04 17:10:17 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2006-07-04 17:10:17 +0000 |
commit | 82ee5f81edbe39dc373ecd0532f333ce76fa608e (patch) | |
tree | bb21bf7bdfd050313433d5fb54cc92b37e95e60e | |
parent | ae623590ccb2fd017d67637b2f52e747b9b4ad73 (diff) |
fixed bug not preserving identity
-rw-r--r-- | src/cli/runtime/PersistentArrayIdentityMap.cs | 5 | ||||
-rw-r--r-- | src/cli/runtime/PersistentArrayMap.cs | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/cli/runtime/PersistentArrayIdentityMap.cs b/src/cli/runtime/PersistentArrayIdentityMap.cs index adef034e..c154c548 100644 --- a/src/cli/runtime/PersistentArrayIdentityMap.cs +++ b/src/cli/runtime/PersistentArrayIdentityMap.cs @@ -26,6 +26,11 @@ override public IPersistentMap empty() { PersistentArrayIdentityMap() {
}
+override internal PersistentArrayMap create(params Object[] init)
+ {
+ return new PersistentArrayIdentityMap(init);
+ }
+
public PersistentArrayIdentityMap(params Object[] init) :base(init) {
}
diff --git a/src/cli/runtime/PersistentArrayMap.cs b/src/cli/runtime/PersistentArrayMap.cs index 02e35275..6cc42aad 100644 --- a/src/cli/runtime/PersistentArrayMap.cs +++ b/src/cli/runtime/PersistentArrayMap.cs @@ -35,6 +35,10 @@ protected PersistentArrayMap(){ this.array = RT.EMPTY_ARRAY;
}
+virtual internal PersistentArrayMap create(params Object[] init){
+ return new PersistentArrayMap(init);
+}
+
/**
* This ctor captures/aliases the passed array, so do not modify later
* @param init {key1,val1,key2,val2,...}
@@ -81,7 +85,7 @@ public IPersistentMap put(Object key, Object val) { newArray[0] = key;
newArray[1] = val;
}
- return new PersistentArrayMap(newArray);
+ return create(newArray);
}
public IPersistentMap remove(Object key) {
@@ -101,7 +105,7 @@ public IPersistentMap remove(Object key) { d += 2;
}
}
- return new PersistentArrayMap(newArray);
+ return create(newArray);
}
//don't have key, no op
return this;
|