diff --git a/src/perf-tests/sets.ts b/src/perf-tests/sets.ts index 7797d8907f3840b85eb2ae902c925b3dca9a7d3c..3580392466e6df2b49fff85df07e42b08d85ff1b 100644 --- a/src/perf-tests/sets.ts +++ b/src/perf-tests/sets.ts @@ -4,7 +4,7 @@ import OrdSet from '../structure/collections/ordered-set' import MSet from '../structure/collections/multi-set' namespace Iteration { - const U = 1000, V = 1000; + const U = 1000, V = 2500; const control: number[] = []; const sets = Object.create(null); @@ -51,7 +51,7 @@ namespace Iteration { export function manual1() { let s = 0; - for (let i = 0, _i = MSet.componentCount(ms); i < _i; i++) { + for (let i = 0, _i = MSet.getSetCount(ms); i < _i; i++) { const set = MSet.getSetByIndex(ms, i); for (let j = 0, _j = OrdSet.size(set); j < _j; j++) { s += OrdSet.get(set, j); diff --git a/src/structure/collections/multi-set.ts b/src/structure/collections/multi-set.ts index 1ab9f9ff30c49d6d1ebc559d4b64eb29163df99a..f7d908d1fcdd1a91cfd88506d3fca302dbb8b581 100644 --- a/src/structure/collections/multi-set.ts +++ b/src/structure/collections/multi-set.ts @@ -28,7 +28,7 @@ namespace MultiSet { return set.keys; } - export function componentCount(set: MultiSet): OrderedSet { + export function getSetCount(set: MultiSet): number { if (typeof set === 'number') return 1; return OrderedSet.size(set.keys); }