Skip to content

Commit

Permalink
Do checks in their own blocks since we don't need the variables later
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Apr 29, 2024
1 parent 845b4f4 commit ea7a85d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions grafast/grafast/src/engine/OperationPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3087,17 +3087,23 @@ export class OperationPlan {
flagLoop: for (const $flag of this.stepTracker.activeSteps) {
if ($flag instanceof __FlagStep) {
// We can only inline it if it's not used by an output plan or layer plan
const outputPlans = this.stepTracker.outputPlansByRootStep.get($flag);
if (outputPlans?.size) {
continue;
{
const usages = this.stepTracker.outputPlansByRootStep.get($flag);
if (usages?.size) {
continue;
}
}
const layerPlans = this.stepTracker.layerPlansByRootStep.get($flag);
if (layerPlans?.size) {
continue;
{
const usages = this.stepTracker.layerPlansByRootStep.get($flag);
if (usages?.size) {
continue;
}
}
const layerPlans2 = this.stepTracker.layerPlansByParentStep.get($flag);
if (layerPlans2?.size) {
continue;
{
const usages = this.stepTracker.layerPlansByParentStep.get($flag);
if (usages?.size) {
continue;
}
}

// We're only going to inline one if we can inline all.
Expand Down

0 comments on commit ea7a85d

Please sign in to comment.