Skip to content

Commit 755a2a9

Browse files
committed
refactor: inline a part of addTasks()
1 parent cef0dfd commit 755a2a9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Query/TaskGroups.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ export class TaskGroups {
3131

3232
const taskGroupingTree = new TaskGroupingTree(groups, tasks);
3333
this.addTasks(taskGroupingTree);
34+
35+
this.sortTaskGroups();
36+
37+
// Get the headings, now that the groups have been sorted.
38+
const displayHeadingSelector = new GroupDisplayHeadingSelector(taskGroupingTree.groups, this._groupers);
39+
for (const group of this._groups) {
40+
group.setGroupHeadings(displayHeadingSelector.getHeadingsForTaskGroup(group.groups));
41+
}
3442
}
3543

3644
/**
@@ -91,14 +99,6 @@ export class TaskGroups {
9199
const taskGroup = new TaskGroup(groups, tasks);
92100
this.add(taskGroup);
93101
}
94-
95-
this.sortTaskGroups();
96-
97-
// Get the headings, now that the groups have been sorted.
98-
const displayHeadingSelector = new GroupDisplayHeadingSelector(taskGroupingTree.groups, this._groupers);
99-
for (const group of this._groups) {
100-
group.setGroupHeadings(displayHeadingSelector.getHeadingsForTaskGroup(group.groups));
101-
}
102102
}
103103

104104
private add(taskGroup: TaskGroup) {

0 commit comments

Comments
 (0)