Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comparison in Tag::is_object #1012

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Fix comparison in Tag::is_object #1012

merged 1 commit into from
Aug 22, 2023

Conversation

brson
Copy link
Contributor

@brson brson commented Aug 22, 2023

What

Fix comparison in Tag::is_object.

Why

This function incorrectly always returns true. The more-commonly-used Val::is_object is correct. This patch makes both functions agree.

I would prefer Val::is_object delegate to Tag::is_object, but that can't be done without constructing a Tag, which has several branches, and I take it Val::is_object is a fast path.

Known limitations

Tag::is_object and Val::is_object duplicate code.

@brson brson requested a review from a team as a code owner August 22, 2023 00:12
@graydon graydon enabled auto-merge (squash) August 22, 2023 02:55
Copy link
Contributor

@graydon graydon left a comment

Choose a reason for hiding this comment

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

Nice catch! LGTM

@graydon graydon merged commit efb27e8 into stellar:main Aug 22, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants