Tidied 'Generate De Bruijn Sequence' operation

This commit is contained in:
n1474335 2023-03-24 22:39:08 +00:00
parent 0a0217cb66
commit d102e1b15c
No known key found for this signature in database
GPG key ID: D15457B7B4AF3F37
2 changed files with 6 additions and 8 deletions

View file

@ -4,8 +4,8 @@
* @license Apache-2.0
*/
import Operation from "../Operation";
import OperationError from "../errors/OperationError";
import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
/**
* Generate De Bruijn Sequence operation
@ -58,9 +58,7 @@ class GenerateDeBruijnSequence extends Operation {
throw new OperationError("Too many permutations, please reduce k^n to under 50,000.");
}
const a = [];
for (let i = 0; i < k * n; i++) a.push(0);
const a = new Array(k * n).fill(0);
const sequence = [];
(function db(t = 1, p = 1) {