🐛 Fix incorrect type coerce operations (#7168)

A regression introduced in previous commits that causes
a browser tab totally killed by memory usage.
This commit is contained in:
Andrey Antukh 2025-08-21 13:52:47 +02:00 committed by GitHub
parent 3f93b0d44b
commit 0e4cf23a93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 12 deletions

View File

@ -96,10 +96,9 @@
(if (and (some? layout-line) (<= from-idx max-idx))
(let [to-idx (+ from-idx (:num-children layout-line))
children (subvec children from-idx to-idx)
[_ modif-tree]
(reduce set-child-modifiers [layout-line modif-tree] children)]
(recur modif-tree (first pending) (rest pending) (long to-idx)))
(recur modif-tree (first pending) (rest pending) to-idx))
modif-tree)))))

View File

@ -177,7 +177,7 @@
(rest children)))))]
(recur next-areas
(+ from-idx (long (:num-children current-line)))
(+ from-idx (:num-children current-line))
(+ (:x line-area) (:width line-area))
(+ (:y line-area) (:height line-area))
(rest lines)))))))

View File

@ -393,17 +393,15 @@
defined by the constant num-segments"
[start end h1 h2]
(let [offset (/ 1 num-segments)
tp (fn [t] (curve-values start end h1 h2 t))]
(loop [from 0
tp (fn [t] (curve-values start end h1 h2 t))]
(loop [from 0.0
result []]
(let [to (min 1 (+ from offset))
line [(tp from) (tp to)]
(let [to (mth/min 1.0 (+ from offset))
line [(tp from) (tp to)]
result (conj result line)]
(if (>= to 1)
(if (>= to 1.0)
result
(recur (long to) result))))))
(recur (double to) result))))))
(defn curve-split
"Splits a curve into two at the given parametric value `t`.

View File

@ -190,4 +190,4 @@
(recur (first subpath)
(rest subpath)
first-point
(long signed-area)))))))
signed-area))))))