Skip to content

Commit

Permalink
Remove needless NO_FLAGS comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed May 1, 2024
1 parent 1876827 commit e3663b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions grafast/grafast/src/engine/LayerPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -410,7 +409,7 @@ export class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason> {
)! as UnaryExecutionValue;
const forbiddenFlags =
fieldValue._entryFlags & FORBIDDEN_BY_NULLABLE_BOUNDARY_FLAGS;
if (forbiddenFlags !== NO_FLAGS) {
if (forbiddenFlags) {
size = 0;
} else {
size = parentBucket.size;
Expand Down Expand Up @@ -628,10 +627,7 @@ export class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason> {
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);
Expand Down
6 changes: 3 additions & 3 deletions grafast/grafast/src/engine/executeBucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand Down

0 comments on commit e3663b6

Please sign in to comment.