gantt-lib 0.135.6 → 0.135.7

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.
@@ -1336,18 +1336,16 @@ function reflowTasksOnModeSwitch(sourceTasks, toBusinessDays, weekendPredicate)
1336
1336
  function buildAdjacencyList(tasks) {
1337
1337
  const graph = /* @__PURE__ */ new Map();
1338
1338
  for (const task of tasks) {
1339
- const successors = [];
1340
- for (const otherTask of tasks) {
1341
- if (otherTask.dependencies) {
1342
- for (const dep of otherTask.dependencies) {
1343
- if (dep.taskId === task.id) {
1344
- successors.push(otherTask.id);
1345
- break;
1346
- }
1347
- }
1339
+ graph.set(task.id, []);
1340
+ }
1341
+ for (const task of tasks) {
1342
+ if (!task.dependencies) continue;
1343
+ for (const dep of task.dependencies) {
1344
+ const bucket = graph.get(dep.taskId);
1345
+ if (bucket) {
1346
+ bucket.push(task.id);
1348
1347
  }
1349
1348
  }
1350
- graph.set(task.id, successors);
1351
1349
  }
1352
1350
  return graph;
1353
1351
  }