Conversation
| let hash1; | ||
| let hash2; | ||
| if (typeof index1 === 'number') { | ||
| context.hashCache1 = context.hashCache1 || []; | ||
| hash1 = context.hashCache1[index1]; | ||
| if (typeof hash1 === 'undefined') { | ||
| context.hashCache1[index1] = hash1 = objectHash(value1, index1); | ||
| } | ||
| } else { | ||
| hash1 = objectHash(value1); | ||
| context.hashCache1 = context.hashCache1 || []; | ||
| let hash1 = context.hashCache1[index1]; | ||
| if (typeof hash1 === 'undefined') { | ||
| context.hashCache1[index1] = hash1 = objectHash(value1, index1); |
There was a problem hiding this comment.
index1 will always be a number based on the usages of this method (i.e., matchItems). matchItems is not exported so there is no concern of it being used differently by users.
| if (typeof index2 === 'number') { | ||
| context.hashCache2 = context.hashCache2 || []; | ||
| hash2 = context.hashCache2[index2]; | ||
| if (typeof hash2 === 'undefined') { | ||
| context.hashCache2[index2] = hash2 = objectHash(value2, index2); | ||
| } | ||
| } else { | ||
| hash2 = objectHash(value2); | ||
| context.hashCache2 = context.hashCache2 || []; | ||
| let hash2 = context.hashCache2[index2]; | ||
| if (typeof hash2 === 'undefined') { | ||
| context.hashCache2[index2] = hash2 = objectHash(value2, index2); |
There was a problem hiding this comment.
index2 will always be a number based on the usages of this method (i.e., matchItems). matchItems is not exported so there is no concern of it being used differently by users.
| result.sequence = result.sequence.join(''); | ||
| } | ||
| return result; | ||
| return backtrack(matrix, array1, array2, innerContext); |
There was a problem hiding this comment.
array1 and array2 are never strings based on the usages of lcs.get. lcs.get is not exported through the package entrypoint so there is no concern of it being used differently by users.
| ? key | ||
| : parseInt(trimUnderscore(key), 10) | ||
| : key; | ||
| const leftKey = arrayKeys ? parseInt(trimUnderscore(key), 10) : key; |
There was a problem hiding this comment.
key cannot be a number because all of the values pushed to the keys array are strings. keys and key are both local variables so there is no concern of it being used differently by users.
Some dead branches observed while working on #342.