* Scan for the next cell that differs between two Int32Arrays. * Returns the number of matching cells before the first difference, * or `count` if all cells match. Tiny and pure for JIT inlining.
( a: Int32Array, b: Int32Array, w0: number, count: number, )
| 1579 | * or `count` if all cells match. Tiny and pure for JIT inlining. |
| 1580 | */ |
| 1581 | function findNextDiff( |
| 1582 | a: Int32Array, |
| 1583 | b: Int32Array, |
| 1584 | w0: number, |
| 1585 | count: number, |
| 1586 | ): number { |
| 1587 | for (let i = 0; i < count; i++, w0 += 2) { |
| 1588 | const w1 = w0 | 1 |
| 1589 | if (a[w0] !== b[w0] || a[w1] !== b[w1]) return i |
| 1590 | } |
| 1591 | return count |
| 1592 | } |
| 1593 | |
| 1594 | /** |
| 1595 | * Diff one row where both screens are in bounds. |