From e3663b65fa2f99ecb4b212e2ffdaf2289b2cbf35 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Wed, 1 May 2024 15:13:28 +0100 Subject: [PATCH] Remove needless NO_FLAGS comparison --- grafast/grafast/src/engine/LayerPlan.ts | 8 ++------ grafast/grafast/src/engine/executeBucket.ts | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/grafast/grafast/src/engine/LayerPlan.ts b/grafast/grafast/src/engine/LayerPlan.ts index 9b44a912f2..f9b1238122 100644 --- a/grafast/grafast/src/engine/LayerPlan.ts +++ b/grafast/grafast/src/engine/LayerPlan.ts @@ -11,7 +11,6 @@ import { FLAG_INHIBITED, FLAG_NULL, FORBIDDEN_BY_NULLABLE_BOUNDARY_FLAGS, - NO_FLAGS, } from "../interfaces.js"; import { resolveType } from "../polymorphic.js"; import type { @@ -410,7 +409,7 @@ export class LayerPlan { )! as UnaryExecutionValue; const forbiddenFlags = fieldValue._entryFlags & FORBIDDEN_BY_NULLABLE_BOUNDARY_FLAGS; - if (forbiddenFlags !== NO_FLAGS) { + if (forbiddenFlags) { size = 0; } else { size = parentBucket.size; @@ -628,10 +627,7 @@ export class LayerPlan { originalIndex++ ) { const flags = polymorphicPlanStore._flagsAt(originalIndex); - if ( - (flags & (FLAG_ERROR | FLAG_INHIBITED | FLAG_NULL)) !== - NO_FLAGS - ) { + if (flags & (FLAG_ERROR | FLAG_INHIBITED | FLAG_NULL)) { continue; } const value = polymorphicPlanStore.at(originalIndex); diff --git a/grafast/grafast/src/engine/executeBucket.ts b/grafast/grafast/src/engine/executeBucket.ts index 039ff0e7ee..5d2e74331b 100644 --- a/grafast/grafast/src/engine/executeBucket.ts +++ b/grafast/grafast/src/engine/executeBucket.ts @@ -593,7 +593,7 @@ export function executeBucket( // Search for "f2b3b1b3" for similar block const flags = depExecutionVal._flagsAt(dataIndex); const disallowedFlags = flags & forbiddenFlags; - if (disallowedFlags !== NO_FLAGS) { + if (disallowedFlags) { indexFlags |= disallowedFlags; // If there's a reject behavior and we're FRESHLY rejected (weren't // already inhibited), use that as a fallback. @@ -815,7 +815,7 @@ export function executeBucket( ) { indexFlags |= FLAG_POLY_SKIPPED; forceIndexValue = null; - } else if (extra._bucket.flagUnion !== NO_FLAGS) { + } else if (extra._bucket.flagUnion) { for ( let i = 0, l = dependenciesIncludingSideEffects.length; i < l; @@ -828,7 +828,7 @@ export function executeBucket( // Search for "f2b3b1b3" for similar block const flags = depExecutionVal._flagsAt(dataIndex); const disallowedFlags = flags & forbiddenFlags; - if (disallowedFlags !== NO_FLAGS) { + if (disallowedFlags) { indexFlags |= disallowedFlags; // If there's a reject behavior and we're FRESHLY rejected (weren't // already inhibited), use that as a fallback.