Skip to content

Fixed boxed math warning, compatible with Clojure 1.10 #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/editscript/diff/a_star.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@
(get-next [this] "Get the next sibling node")
(set-next [this node] "Set the next sibling node")
(set-order [this o] "Set the traversal order of this node")
#?(:clj (get-order ^long [this] "Get the order of this node in traversal")
:cljs (^number get-order [this] "Get the order of this node in traversal"))
#?(:clj (get-size ^long [this] "Get the size of sub-tree, used to estimate cost")
:cljs (^number get-size [this] "Get the size of sub-tree, used to estimate cost"))
(get-order [this] "Get the order of this node in traversal")
(get-size [this] "Get the size of sub-tree, used to estimate cost")
(set-size [this s] "Set the size of sub-tree"))

(deftype Node [^PersistentVector path
Expand Down Expand Up @@ -120,7 +118,7 @@
:set (set-children order path data node)
:lst (list-children order path data node))
(let [^long cs (->> (get-children node) vals (map get-size) (reduce +))
size (+ (get-size node) cs)]
size (+ (long (get-size node)) cs)]
(doto node
(set-order @order)
(set-size size))
Expand Down