Clean up findChildIndex (#16984)

This commit is contained in:
Andy 2017-07-07 10:15:04 -07:00 committed by GitHub
parent ba8e5a7e24
commit ba53b42663

View File

@ -839,10 +839,9 @@ namespace ts.server {
this.children.length--;
}
findChildIndex(child: LineCollection) {
let childIndex = 0;
const clen = this.children.length;
while ((this.children[childIndex] !== child) && (childIndex < clen)) childIndex++;
private findChildIndex(child: LineCollection) {
const childIndex = this.children.indexOf(child);
Debug.assert(childIndex !== -1);
return childIndex;
}