refactor(): use const and let instead of var

This commit is contained in:
Joao Dias
2016-11-12 14:08:58 +01:00
committed by Victor Berchet
parent 73593d4bf3
commit 77ee27c59e
435 changed files with 4637 additions and 4663 deletions

View File

@ -57,7 +57,7 @@ export class Tree<T> {
function findNode<T>(expected: T, c: TreeNode<T>): TreeNode<T> {
if (expected === c.value) return c;
for (let cc of c.children) {
for (const cc of c.children) {
const r = findNode(expected, cc);
if (r) return r;
}
@ -68,7 +68,7 @@ function findPath<T>(expected: T, c: TreeNode<T>, collected: TreeNode<T>[]): Tre
collected.push(c);
if (expected === c.value) return collected;
for (let cc of c.children) {
for (const cc of c.children) {
const cloned = collected.slice(0);
const r = findPath(expected, cc, cloned);
if (r.length > 0) return r;