diff --git a/__tests__/SingleThread.test.ts b/__tests__/SingleThread.test.ts index d7d2e4c..eb1e023 100644 --- a/__tests__/SingleThread.test.ts +++ b/__tests__/SingleThread.test.ts @@ -19,7 +19,7 @@ describe('SingleThread', () => { // writeFileSync(`./__tests__/fixtures/sarafu-300.solution`, solution); // } expect(solution).toEqual(read); - expect(cummNumProbes).toEqual(3); + expect(cummNumProbes).toEqual(22); expect(await threadRunner.solutionIsComplete()).toEqual(true); }); diff --git a/__tests__/fixtures/sarafu-300.solution b/__tests__/fixtures/sarafu-300.solution index fd6e0ba..7bbcabc 100644 --- a/__tests__/fixtures/sarafu-300.solution +++ b/__tests__/fixtures/sarafu-300.solution @@ -1 +1 @@ -(2-0:0) [2 1 3 2] +(2-0:3) [2 1 3 2] diff --git a/src/Worker.ts b/src/Worker.ts index 969080c..ae9bbf3 100644 --- a/src/Worker.ts +++ b/src/Worker.ts @@ -217,14 +217,10 @@ export class Worker { await readSarafuCsv(filename, (from: string, to: string, amount: number) => { if (parseInt(from) % this.numWorkers === this.workerNo) { if (parseInt(from) % this.numWorkers === this.workerNo) { - if (['1','2','3'].indexOf(from) === -1) { + if (parseInt(from) === 0) { this.debug(`skipping transaction from ${from}`); return; } - if (['1','2','3'].indexOf(to) === -1) { - this.debug(`skipping transaction to ${to}`); - return; - } this.debug(`not skipping transaction from ${from} to ${to}`); this.addWeight(from, to, amount); } @@ -236,15 +232,6 @@ export class Worker { const [ from, to, amountStr ] = cells; const amount = parseFloat(amountStr); if (parseInt(from) % this.numWorkers === this.workerNo) { - if (['1','2','3'].indexOf(from) === -1) { - this.debug(`skipping transaction from ${from}`); - return; - } - if (['1','2','3'].indexOf(to) === -1) { - this.debug(`skipping transaction to ${to}`); - return; - } - this.debug(`not skipping transaction from ${from} to ${to}`); this.addWeight(from, to, amount); } });