Skip to content

Commit d099942

Browse files
Replace 'Idx' with 'Index' in variable names (#3194)
1 parent df1bdda commit d099942

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ async function runBenchmarks(benchmarks, benchmarkProjects) {
274274
}
275275

276276
function getArguments(argv) {
277-
const revsIdx = argv.indexOf('--revs');
278-
const revisions = revsIdx === -1 ? [] : argv.slice(revsIdx + 1);
279-
const benchmarks = revsIdx === -1 ? argv : argv.slice(0, revsIdx);
277+
const revsIndex = argv.indexOf('--revs');
278+
const revisions = revsIndex === -1 ? [] : argv.slice(revsIndex + 1);
279+
const benchmarks = revsIndex === -1 ? argv : argv.slice(0, revsIndex);
280280

281281
switch (revisions.length) {
282282
case 0:

src/jsutils/naturalCompare.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
*
77
*/
88
export function naturalCompare(aStr: string, bStr: string): number {
9-
let aIdx = 0;
10-
let bIdx = 0;
9+
let aIndex = 0;
10+
let bIndex = 0;
1111

12-
while (aIdx < aStr.length && bIdx < bStr.length) {
13-
let aChar = aStr.charCodeAt(aIdx);
14-
let bChar = bStr.charCodeAt(bIdx);
12+
while (aIndex < aStr.length && bIndex < bStr.length) {
13+
let aChar = aStr.charCodeAt(aIndex);
14+
let bChar = bStr.charCodeAt(bIndex);
1515

1616
if (isDigit(aChar) && isDigit(bChar)) {
1717
let aNum = 0;
1818
do {
19-
++aIdx;
19+
++aIndex;
2020
aNum = aNum * 10 + aChar - DIGIT_0;
21-
aChar = aStr.charCodeAt(aIdx);
21+
aChar = aStr.charCodeAt(aIndex);
2222
} while (isDigit(aChar) && aNum > 0);
2323

2424
let bNum = 0;
2525
do {
26-
++bIdx;
26+
++bIndex;
2727
bNum = bNum * 10 + bChar - DIGIT_0;
28-
bChar = bStr.charCodeAt(bIdx);
28+
bChar = bStr.charCodeAt(bIndex);
2929
} while (isDigit(bChar) && bNum > 0);
3030

3131
if (aNum < bNum) {
@@ -42,8 +42,8 @@ export function naturalCompare(aStr: string, bStr: string): number {
4242
if (aChar > bChar) {
4343
return 1;
4444
}
45-
++aIdx;
46-
++bIdx;
45+
++aIndex;
46+
++bIndex;
4747
}
4848
}
4949

0 commit comments

Comments
 (0)