Skip to content

Commit 4b411f7

Browse files
committed
consistency with naming indices
1 parent 3d0d11c commit 4b411f7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/dictionary/parallel_parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export class Parser {
6868
async parse(source: string): Promise<Dictionary> {
6969
const heads = [...source.matchAll(HEADS)].map((match) => match.index);
7070
const regionPositions = [...new Array(this.#workers.length).keys()]
71-
.map((index) => {
72-
const start = index * source.length / this.#workers.length;
71+
.map((i) => {
72+
const start = i * source.length / this.#workers.length;
7373
for (const head of heads) {
7474
if (start <= head) {
7575
return head;

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ function main() {
281281
function moreOutput() {
282282
const errors: Array<ResultError> = [];
283283
let yielded = false;
284-
let i = 0;
285-
while (i < Math.min(INITIAL_PAGE_SIZE * 2 ** size, MAX_PAGE_SIZE)) {
284+
let count = 0;
285+
while (count < Math.min(INITIAL_PAGE_SIZE * 2 ** size, MAX_PAGE_SIZE)) {
286286
const next = output!.next();
287287
if (!next.done) {
288288
const { value: result } = next;
@@ -292,7 +292,7 @@ function main() {
292292
const list = document.createElement("li");
293293
list.innerHTML = result.value;
294294
outputList.appendChild(list);
295-
i++;
295+
count++;
296296
break;
297297
}
298298
case "error":

0 commit comments

Comments
 (0)