summaryrefslogtreecommitdiff
path: root/src/cli/runtime/PersistentArrayMap.cs
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-07-04 17:10:17 +0000
committerRich Hickey <richhickey@gmail.com>2006-07-04 17:10:17 +0000
commit82ee5f81edbe39dc373ecd0532f333ce76fa608e (patch)
treebb21bf7bdfd050313433d5fb54cc92b37e95e60e /src/cli/runtime/PersistentArrayMap.cs
parentae623590ccb2fd017d67637b2f52e747b9b4ad73 (diff)
fixed bug not preserving identity
Diffstat (limited to 'src/cli/runtime/PersistentArrayMap.cs')
-rw-r--r--src/cli/runtime/PersistentArrayMap.cs8
1 files changed, 6 insertions, 2 deletions
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;