Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

chore: Use new cmp package to simplify comparisons#63029

Merged
varungandhi-src merged 1 commit intomainfrom
vg/cmp
Jun 3, 2024
Merged

chore: Use new cmp package to simplify comparisons#63029
varungandhi-src merged 1 commit intomainfrom
vg/cmp

Conversation

@varungandhi-src
Copy link
Contributor

@varungandhi-src varungandhi-src commented Jun 3, 2024

There is also a cmp.Or function but since that's a function and
not a macro, it would cause all comparisons to always happen,
so we don't use that for chaining results.

Test plan

Covered by existing tests

Changelog

@cla-bot cla-bot bot added the cla-signed label Jun 3, 2024
@github-actions github-actions bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jun 3, 2024
@varungandhi-src varungandhi-src changed the base branch from main to vg/remove-dead-code-2 June 3, 2024 06:19
Base automatically changed from vg/remove-dead-code-2 to main June 3, 2024 06:25
@varungandhi-src varungandhi-src requested a review from mmanela June 3, 2024 11:38
Copy link
Contributor

@kritzcreek kritzcreek left a comment

Choose a reason for hiding this comment

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

LGTM, I was confused about the "macro" comment at first... but after googling for "go macros" for a while I think you wanted to convey that there's no way to lazily evaluate the arguments to cmp.Or.

@varungandhi-src
Copy link
Contributor Author

but after googling for "go macros" for a while I think you wanted to convey that there's no way to lazily evaluate the arguments to cmp.Or

I did mean macro, because macros are much more common in languages like Rust, C etc. whereas lazy evaluation is not that common. In most languages, the usual or operator || is macro-like, it doesn't do lazy evaluation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants