Skip to content

Commit

Permalink
Replace nonce Pointer with actual path inside array
Browse files Browse the repository at this point in the history
  • Loading branch information
chbrown committed Feb 17, 2022
1 parent 4da52c0 commit f0de16e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function diffArrays<T>(input: T[], output: T[], ptr: Pointer, diff: Diff
let memoized = memo[memo_key]
if (memoized === undefined) {
// TODO: this !diff(...).length usage could/should be lazy
if (i > 0 && j > 0 && !diff(input[i - 1], output[j - 1], new Pointer()).length) {
if (i > 0 && j > 0 && !diff(input[i - 1], output[j - 1], ptr.add(String(i - 1))).length) {
// equal (no operations => no cost)
memoized = dist(i - 1, j - 1)
}
Expand Down

0 comments on commit f0de16e

Please sign in to comment.