Skip to content

Commit 868a221

Browse files
committed
polish(incremental): improve readability with destructuring
1 parent d57d5c7 commit 868a221

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/execution/IncrementalGraph.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,23 @@ export class IncrementalGraph {
4949
addCompletedSuccessfulExecutionGroup(
5050
successfulExecutionGroup: SuccessfulExecutionGroup,
5151
): void {
52-
for (const deferredFragmentRecord of successfulExecutionGroup
53-
.pendingExecutionGroup.deferredFragmentRecords) {
54-
deferredFragmentRecord.pendingExecutionGroups.delete(
55-
successfulExecutionGroup.pendingExecutionGroup,
56-
);
57-
deferredFragmentRecord.successfulExecutionGroups.add(
58-
successfulExecutionGroup,
59-
);
52+
const { pendingExecutionGroup, incrementalDataRecords } =
53+
successfulExecutionGroup;
54+
55+
const deferredFragmentRecords =
56+
pendingExecutionGroup.deferredFragmentRecords;
57+
58+
for (const deferredFragmentRecord of deferredFragmentRecords) {
59+
const { pendingExecutionGroups, successfulExecutionGroups } =
60+
deferredFragmentRecord;
61+
pendingExecutionGroups.delete(pendingExecutionGroup);
62+
successfulExecutionGroups.add(successfulExecutionGroup);
6063
}
6164

62-
const incrementalDataRecords =
63-
successfulExecutionGroup.incrementalDataRecords;
6465
if (incrementalDataRecords !== undefined) {
6566
this._addIncrementalDataRecords(
6667
incrementalDataRecords,
67-
successfulExecutionGroup.pendingExecutionGroup.deferredFragmentRecords,
68+
deferredFragmentRecords,
6869
);
6970
}
7071
}

0 commit comments

Comments
 (0)