Skip to content

Commit

Permalink
retractions: Fix bug converting 'set from PersistentHashSet to LazySeq.
Browse files Browse the repository at this point in the history
This issue does not affect external correctness but will adversely
affect performance in the presence of duplicated facts.
  • Loading branch information
abrooks authored and David Nolen committed Sep 5, 2012
1 parent 09131fc commit 9bc6eb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/core/logic.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2769,7 +2769,7 @@
(let [rel-ns (:ns (meta rel)) (let [rel-ns (:ns (meta rel))
rel-set (var-get (ns-resolve rel-ns (set-sym (.name rel) arity))) rel-set (var-get (ns-resolve rel-ns (set-sym (.name rel) arity)))
tuples (map vec tuples)] tuples (map vec tuples)]
(swap! rel-set (fn [s] (remove #(some #{%} tuples) s))) (swap! rel-set (fn [s] (reduce disj s tuples)))
(let [indexes (indexes-for rel arity)] (let [indexes (indexes-for rel arity)]
(doseq [[o i] indexes] (doseq [[o i] indexes]
(let [index (var-get (ns-resolve rel-ns (index-sym (.name rel) arity o)))] (let [index (var-get (ns-resolve rel-ns (index-sym (.name rel) arity o)))]
Expand Down

0 comments on commit 9bc6eb4

Please sign in to comment.