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

container/bitlpm: Add Lookup Boolean Return Value #31037

Conversation

nathanjsweet
Copy link
Member

@nathanjsweet nathanjsweet commented Feb 28, 2024

Lookup currently returns the default value of
the bitlpm.Trie when it fails to find a match.
There are cases where comparing the
default value to the return value is logically expensive
(i.e. code needs to be written to do the comparison).
Lookup can easily return a boolean value to indicate
whether Lookup failed, making it easier for library
users to determine if Lookup failed.

@nathanjsweet nathanjsweet added the release-note/misc This PR makes changes that have no direct user impact. label Feb 28, 2024
@nathanjsweet nathanjsweet requested review from a team as code owners February 28, 2024 17:04
Lookup currently returns the default value of
the bitlpm.Trie when it fails to find a match.
There are cases where comparing the default
value to the return value is logically expensive
(i.e. code needs to be written to do the comparison).
Lookup can easily return a boolean value to indicate
whether it failed.

Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
@nathanjsweet nathanjsweet force-pushed the pr/nathanjsweet/update-bitlpm-lookup-to-return-success-boolean branch from 139f71e to 8a8ce3d Compare March 1, 2024 22:54
@nathanjsweet
Copy link
Member Author

/test

@nathanjsweet nathanjsweet added needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Mar 4, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.15.2 Mar 4, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.14.8 Mar 4, 2024
@nathanjsweet nathanjsweet added this pull request to the merge queue Mar 4, 2024
Merged via the queue into main with commit 5a96a95 Mar 4, 2024
220 checks passed
@nathanjsweet nathanjsweet deleted the pr/nathanjsweet/update-bitlpm-lookup-to-return-success-boolean branch March 4, 2024 21:04
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 4, 2024
@pippolo84 pippolo84 mentioned this pull request Mar 5, 2024
13 tasks
@pippolo84 pippolo84 added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Mar 5, 2024
@pippolo84 pippolo84 mentioned this pull request Mar 5, 2024
7 tasks
@pippolo84 pippolo84 added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Mar 5, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.2 Mar 5, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.14 in 1.14.8 Mar 5, 2024
@github-actions github-actions bot added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Mar 11, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed this from Backport pending to v1.15 in 1.15.2 Mar 11, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.14 to Backport done to v1.14 in 1.14.8 Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
1.14.8
Backport done to v1.14
Development

Successfully merging this pull request may close these issues.

None yet

3 participants