mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 07:11:00 +02:00
Merge pull request #21200 from Snuffleupagus/Intersector-grid-push
Shorten how intersectors are added to the grid in the `Intersector` constructor
This commit is contained in:
commit
adf07ea51c
@ -192,11 +192,7 @@ class Intersector {
|
||||
const h = Math.floor((iMax - iMin) / STEPS);
|
||||
for (let i = iMin; i <= iMin + h * STEPS; i += STEPS) {
|
||||
for (let j = 0; j <= w; j++) {
|
||||
let existing = this.#grid[i + j];
|
||||
if (!existing) {
|
||||
this.#grid[i + j] = existing = [];
|
||||
}
|
||||
existing.push(intersector);
|
||||
(this.#grid[i + j] ??= []).push(intersector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user