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.
@@ -1263,18 +1263,16 @@ function reflowTasksOnModeSwitch(sourceTasks, toBusinessDays, weekendPredicate)
1263
1263
  function buildAdjacencyList(tasks) {
1264
1264
  const graph = /* @__PURE__ */ new Map();
1265
1265
  for (const task of tasks) {
1266
- const successors = [];
1267
- for (const otherTask of tasks) {
1268
- if (otherTask.dependencies) {
1269
- for (const dep of otherTask.dependencies) {
1270
- if (dep.taskId === task.id) {
1271
- successors.push(otherTask.id);
1272
- break;
1273
- }
1274
- }
1266
+ graph.set(task.id, []);
1267
+ }
1268
+ for (const task of tasks) {
1269
+ if (!task.dependencies) continue;
1270
+ for (const dep of task.dependencies) {
1271
+ const bucket = graph.get(dep.taskId);
1272
+ if (bucket) {
1273
+ bucket.push(task.id);
1275
1274
  }
1276
1275
  }
1277
- graph.set(task.id, successors);
1278
1276
  }
1279
1277
  return graph;
1280
1278
  }