Browse Source

collections

David Sehnal 7 years ago
parent
commit
4e2fe6b27a
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/perf-tests/sets.ts
  2. 1 1
      src/structure/collections/multi-set.ts

+ 2 - 2
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);

+ 1 - 1
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);
     }