This commit is contained in:
Konrad Pabjan 2020-07-09 16:51:40 +02:00
parent 9ee6dab9c2
commit 596040d10f
2 changed files with 6 additions and 6 deletions

4
dist/index.js vendored
View File

@ -6275,11 +6275,11 @@ function getMultiPathLCA(searchPaths) {
// Loop over all the search paths until there is a non-common ancestor or we go out of bounds // Loop over all the search paths until there is a non-common ancestor or we go out of bounds
while (splitIndex < smallestPathLength) { while (splitIndex < smallestPathLength) {
if (!isPathTheSame()) { if (!isPathTheSame()) {
break;
}
// if all are the same, add to the end result & increment the index // if all are the same, add to the end result & increment the index
commonPaths.push(splitPaths[0][splitIndex]); commonPaths.push(splitPaths[0][splitIndex]);
splitIndex++; splitIndex++;
break;
}
} }
return path.join(...commonPaths); return path.join(...commonPaths);
} }

View File

@ -67,11 +67,11 @@ function getMultiPathLCA(searchPaths: string[]): string {
// Loop over all the search paths until there is a non-common ancestor or we go out of bounds // Loop over all the search paths until there is a non-common ancestor or we go out of bounds
while (splitIndex < smallestPathLength) { while (splitIndex < smallestPathLength) {
if (!isPathTheSame()) { if (!isPathTheSame()) {
break
}
// if all are the same, add to the end result & increment the index // if all are the same, add to the end result & increment the index
commonPaths.push(splitPaths[0][splitIndex]) commonPaths.push(splitPaths[0][splitIndex])
splitIndex++ splitIndex++
break
}
} }
return path.join(...commonPaths) return path.join(...commonPaths)
} }