Apply prefer-const lint rule

This commit is contained in:
Zaid Abdulla committed 2018-08-25 16:14:34 -07:00
1 parent b43088c03c
commit 09e6a360af
26 files changed
+217 -215

No files matched your search

+4 -4
View File
@@ -34,11 +34,11 @@ function estimateGpnCount(gpnPatterns, depth = 0) {
let wildcardDiscovered = false;
let gpnCount = 0;
for (let pattern of gpnPatterns) {
for (const pattern of gpnPatterns) {
const path = pattern[0];
const flags = pattern[1] >> depth;
let k = path[depth];
const k = path[depth];
if (!k) {
if (flags & 1) gpnCount = 1;
@@ -67,8 +67,8 @@ function estimateGpnCount(gpnPatterns, depth = 0) {
estimateGpnCount(wildcardChildren, depth + 1) * WILDCARD_MULTIPLIER;
}
for (let k of Object.keys(children)) {
let c = estimateGpnCount(children[k].concat(wildcardChildren), depth + 1);
for (const k of Object.keys(children)) {
const c = estimateGpnCount(children[k].concat(wildcardChildren), depth + 1);
wildcardGpnCount -= c;
gpnCount += c;
}