Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 60x 3457x 3457x 3457x 3457x 435x 435x 435x 435x 435x 430x 430x 430x 285x 3457x | import type {SliceTypeSteps} from '../slice'; export const commonLength = (a: SliceTypeSteps, b: SliceTypeSteps): number => { const aLength = a.length; const bLength = b.length; let i = 0; while (i < aLength && i < bLength) { const aStep = a[i]; const bStep = b[i]; const aTag = Array.isArray(aStep) ? aStep[0] : aStep; const bTag = Array.isArray(bStep) ? bStep[0] : bStep; if (aTag !== bTag) break; const aDiscriminant = Array.isArray(aStep) ? aStep[1] : 0; const bDiscriminant = Array.isArray(bStep) ? bStep[0] : 0; if (aDiscriminant !== bDiscriminant) break; i++; } return i; }; |