Repo // Megrez v2.0.1 update.

- Stop overfixing in fetchOverlappingNodes().
This commit is contained in:
ShikiSuen 2022-08-10 19:07:05 +08:00
parent c6c18b9196
commit 9a7186b3ba
1 changed files with 2 additions and 6 deletions

View File

@ -79,12 +79,8 @@ extension Megrez.Compositor {
//
let begin: Int = location - min(location, Megrez.Compositor.maxSpanLength - 1)
for theLocation in begin..<location {
let (A, B): (Int, Int) = {
(
min(location - theLocation + 1, spans[theLocation].maxLength),
max(location - theLocation + 1, spans[theLocation].maxLength)
)
}()
let (A, B): (Int, Int) = (location - theLocation + 1, spans[theLocation].maxLength)
guard A <= B else { continue }
for theLength in A...B {
guard let node = spans[theLocation].nodeOf(length: theLength) else { continue }
results.append(.init(node: node, spanIndex: theLocation))