We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 861e2e4 commit 0633ca8Copy full SHA for 0633ca8
src/translator/translator.ts
@@ -19,9 +19,8 @@ export function translate(tokiPona: string): IterableResult<string> {
19
const aggregateErrors: Array<ResultError> = [];
20
const unique: Set<string> = new Set();
21
if (settings.randomize) {
22
- let i = 0;
23
for (const result of iterableResult.iterable()) {
24
- if (i >= RANDOMIZATION_LIMIT) {
+ if (unique.size >= RANDOMIZATION_LIMIT) {
25
yield {
26
type: "error",
27
error: new ResultError("too much output to shuffle"),
@@ -31,7 +30,6 @@ export function translate(tokiPona: string): IterableResult<string> {
31
30
switch (result.type) {
32
case "value":
33
unique.add(result.value);
34
- i++;
35
break;
36
case "error":
37
aggregateErrors.push(result.error);
0 commit comments