提交 7fabf450 编写于 作者: I isidor

no need to do any checks if there are no children

上级 b054ebb5
......@@ -302,17 +302,18 @@ export class FileStat implements IFileStat {
if (paths.isEqual(this.resource.path, path, !isLinux)) {
return this;
}
while (index < path.length && path[index] === paths.sep) {
index++;
}
let indexOfNextSep = path.indexOf(paths.sep, index);
if (indexOfNextSep === -1) {
indexOfNextSep = path.length - 1;
}
const name = path.substring(index, indexOfNextSep);
if (this.children) {
while (index < path.length && path[index] === paths.sep) {
index++;
}
let indexOfNextSep = path.indexOf(paths.sep, index);
if (indexOfNextSep === -1) {
indexOfNextSep = path.length - 1;
}
const name = path.substring(index, indexOfNextSep);
const found = binarySearch(this.children.map(c => c.name), name, (first, second) => isLinux ? compare(first, second) : compareIgnoreCase(first, second));
if (found >= 0 && found < this.children.length) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册