Skip to content

Commit 89ad4ab

Browse files
Chouserrichhickey
authored andcommitted
empty for sorted-map and sorted-set now maintain comparator. Fixes #128
Signed-off-by: Rich Hickey <[email protected]>
1 parent 2160745 commit 89ad4ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/jvm/clojure/lang/PersistentTreeMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public ISeq seq(){
137137
}
138138

139139
public IPersistentCollection empty(){
140-
return EMPTY.withMeta(meta());
140+
return new PersistentTreeMap(meta(), comp);
141141
}
142142

143143
public ISeq rseq() throws Exception{

src/jvm/clojure/lang/PersistentTreeSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public IPersistentSet cons(Object o){
5353
}
5454

5555
public IPersistentCollection empty(){
56-
return EMPTY.withMeta(meta());
56+
return new PersistentTreeSet(meta(),(PersistentTreeMap)impl.empty());
5757
}
5858

5959
public ISeq rseq() throws Exception{

0 commit comments

Comments
 (0)