Skip to content

Commit

Permalink
replaced var-get's with deref, fix for camsaul#52
Browse files Browse the repository at this point in the history
  • Loading branch information
eoliphan committed Jul 25, 2021
1 parent 676e17a commit 71fce71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/methodical/impl/dispatcher/everything.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@

(matching-primary-methods [_ method-table _]
(let [primary-methods (i/primary-methods method-table)
comparitor (dispatcher.common/domination-comparitor (var-get hierarchy-var) prefs)]
comparitor (dispatcher.common/domination-comparitor (deref hierarchy-var) prefs)]
(for [[dispatch-value method] (sort-by first comparitor primary-methods)]
(vary-meta method assoc :dispatch-value dispatch-value))))

(matching-aux-methods [_ method-table _]
(let [aux-methods (i/aux-methods method-table)
comparitor (dispatcher.common/domination-comparitor (var-get hierarchy-var) prefs)]
comparitor (dispatcher.common/domination-comparitor (deref hierarchy-var) prefs)]
(into {} (for [[qualifier dispatch-value->methods] aux-methods]
[qualifier (for [[dispatch-value methods] (sort-by first comparitor dispatch-value->methods)
method methods]
Expand All @@ -61,4 +61,4 @@
(EverythingDispatcher. hierarchy-var new-prefs))))

(dominates? [_ x y]
(dispatcher.common/dominates? (var-get hierarchy-var) prefs x y)))
(dispatcher.common/dominates? (deref hierarchy-var) prefs x y)))
2 changes: 1 addition & 1 deletion src/methodical/impl/dispatcher/multi_default.clj
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@
(MultiDefaultDispatcher. dispatch-fn hierarchy-var default-value new-prefs))))

(dominates? [_ x y]
(dispatcher.common/dominates? (var-get hierarchy-var) prefs default-value x y)))
(dispatcher.common/dominates? (deref hierarchy-var) prefs default-value x y)))
2 changes: 1 addition & 1 deletion src/methodical/impl/dispatcher/standard.clj
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@
(StandardDispatcher. dispatch-fn hierarchy-var default-value new-prefs))))

(dominates? [_ x y]
(dispatcher.common/dominates? (var-get hierarchy-var) prefs default-value x y)))
(dispatcher.common/dominates? (deref hierarchy-var) prefs default-value x y)))

0 comments on commit 71fce71

Please sign in to comment.