Skip to content

Commit 936c57d

Browse files
committed
🚑 Fix type coercion warning
1 parent 4420a82 commit 936c57d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/progress/indeterminate.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@
124124
bg-colour :default
125125
attributes [:default]
126126
space-after-indicator? true}}]
127-
(let [delay-in-ms (long (Math/round (double delay-in-ms)))] ; Coerce delay-in-ms to a long (especially if it's a Clojure ratio)
127+
(let [delay-in-ms (long (Math/round (double delay-in-ms))) ; Coerce delay-in-ms to a long (especially if it's a Clojure ratio)
128+
frame-count (count frames)]
128129
; Setup logic
129130
(ansi/save-cursor!)
130131
(ansi/hide-cursor!)
@@ -141,7 +142,7 @@
141142
(ansi/restore-cursor!)
142143
(print-pending-messages)
143144
(when (active?)
144-
(recur (mod (inc i) (count frames))))))
145+
(recur (int (mod (inc i) frame-count))))))
145146
; Clean up logic
146147
(ansi/restore-cursor!)
147148
(jansi/erase-line!)

0 commit comments

Comments
 (0)