Skip to content

RuleBuilder: Optimize Has("Item", 0)#6228

Open
Ishigh1 wants to merge 2 commits into
ArchipelagoMW:mainfrom
Ishigh1:has_0
Open

RuleBuilder: Optimize Has("Item", 0)#6228
Ishigh1 wants to merge 2 commits into
ArchipelagoMW:mainfrom
Ishigh1:has_0

Conversation

@Ishigh1

@Ishigh1 Ishigh1 commented May 26, 2026

Copy link
Copy Markdown
Contributor

What is this fixing or adding?

I was writing my rules and stumbled into a case where it made sense to call has("item", 0) (in a generic function), and it felt wrong to just leave the rule there. I checked the case <= 0 in my code but I felt like I may as well PR the change.
The cost in resolve is minimal, and the time save when it's applied is significant, so I figured it had its place here

How was this tested?

Added a new unit test, which passes

@github-actions github-actions Bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels May 26, 2026

@Jouramie Jouramie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good thing to check.

@Jouramie Jouramie added the is: enhancement Issues requesting new features or pull requests implementing new features. label May 26, 2026
@drtchops drtchops added waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects: core Issues/PRs that touch core and may need additional validation. is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants