Skip to content

Commit 5f47b5d

Browse files
committed
impr(polyglot): Small refactoring in Wordset classes. (@IliyaZinoviev)
1 parent 52be7ba commit 5f47b5d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

frontend/src/ts/test/funbox/funbox-functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class PolyglotWordset extends Wordset {
161161
this.wordsMap = wordsMap;
162162
this.resetIndexes();
163163
this.length = Array.from(this.wordsMap.values()).reduce(
164-
(sum, ws) => sum + ws.words.length,
164+
(sum, ws) => sum + ws.length,
165165
0,
166166
);
167167
this.currLang = this.langs[0] as Language;
@@ -172,7 +172,7 @@ export class PolyglotWordset extends Wordset {
172172
}
173173

174174
override resetIndexes(): void {
175-
this.wordsMap.forEach((ws, _) => {
175+
this.wordsMap.forEach((ws) => {
176176
ws.resetIndexes();
177177
});
178178
}

frontend/src/ts/test/wordset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Wordset {
2525

2626
randomWord(mode: FunboxWordsFrequency): string {
2727
if (mode === "zipf") {
28-
return this.words[zipfyRandomArrayIndex(this.words.length)] as string;
28+
return this.words[zipfyRandomArrayIndex(this.length)] as string;
2929
} else {
3030
return randomElementFromArray(this.words);
3131
}

0 commit comments

Comments
 (0)