Precise DOM morphing
morphing typescript dom

remove redundant id check in exact-id matching

+2 -4
+2 -4
src/morphlex.ts
··· 570 570 for (let c = 0; c < candidateBucket.length; c++) { 571 571 const candidateIndex = candidateBucket[c]! 572 572 if (!candidateElementWithIdActive[candidateIndex]) continue 573 - const candidate = fromChildNodes[candidateIndex] as Element 574 573 575 - if (localNameMap[unmatchedIndex] === candidateLocalNameMap[candidateIndex] && id === candidate.id) { 574 + if (localNameMap[unmatchedIndex] === candidateLocalNameMap[candidateIndex]) { 576 575 matches[unmatchedIndex] = candidateIndex 577 576 op[unmatchedIndex] = Operation.SameElement 578 577 candidateElementWithIdActive[candidateIndex] = 0 ··· 584 583 const candidateIndex = candidateBucket 585 584 if (!candidateElementWithIdActive[candidateIndex]) continue 586 585 587 - const candidate = fromChildNodes[candidateIndex] as Element 588 - if (localNameMap[unmatchedIndex] === candidateLocalNameMap[candidateIndex] && id === candidate.id) { 586 + if (localNameMap[unmatchedIndex] === candidateLocalNameMap[candidateIndex]) { 589 587 matches[unmatchedIndex] = candidateIndex 590 588 op[unmatchedIndex] = Operation.SameElement 591 589 candidateElementWithIdActive[candidateIndex] = 0