rm-webgpu-compute-tasks 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-webgpu-compute-tasks",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/index.js CHANGED
@@ -3182,9 +3182,9 @@ async function sopc_(opt) {
3182
3182
  }
3183
3183
  arrayMap.append(itemIndex - 1, i);
3184
3184
  }
3185
- const results = new Array(itemsFiles.length).fill([]).map(() => []);
3185
+ const results = Array.from({ length: itemsFiles.length }, () => []);
3186
3186
  const sort = (pointarr) => {
3187
- let list = euclideanClusterExtraction(pointarr, 0.2).sort((a, b) => b.length - a.length);
3187
+ let list = euclideanClusterExtraction(pointarr, 0.25).sort((a, b) => b.length - a.length);
3188
3188
  if (list.length === 1) return pointarr;
3189
3189
  return list[0].flatMap((i) => [
3190
3190
  pointarr[i * 3],
@@ -3203,7 +3203,10 @@ async function sopc_(opt) {
3203
3203
  );
3204
3204
  });
3205
3205
  pointarr = sort(pointarr);
3206
- if (!results[fileIndex]) results[fileIndex] = new Array(itemsFiles[fileIndex].sam3Objects.length).fill([]);
3206
+ if (results[fileIndex].length === 0) {
3207
+ const count = itemsFiles[fileIndex].sam3Objects.length;
3208
+ results[fileIndex] = Array.from({ length: count }, () => []);
3209
+ }
3207
3210
  results[fileIndex][itemIndex] = pointarr;
3208
3211
  });
3209
3212
  });