Skip to content

Fix reflection warnings #10

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/clj/clj_diff/optimizations.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Return a diff if the shorter sequence exists in the longer one. No need to
use the expensive diff algorithm for this."
[^String a ^String b ^Integer ca ^Integer cb]
(let [[short long] (if (> ca cb) [b a] [a b])
(let [[^String short ^String long] (if (> ca cb) [b a] [a b])
i (int (.indexOf long short))]
(if (= i -1)
nil
Expand All @@ -34,7 +34,7 @@
(range (+ i cb) ca)))}))))

(defn- half-match* [^String long ^String short ^Integer i]
(let [target (.substring long i (+ i (quot (count long) 4)))]
(let [^String target (.substring long i (+ i (quot (count long) 4)))]
(loop [j (.indexOf short target 0)
result []]
(if (= j -1)
Expand Down