-
Notifications
You must be signed in to change notification settings - Fork 283
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
IH-640: Eliminate unnecessary usage of List.length to check for empty lists #5762
IH-640: Eliminate unnecessary usage of List.length to check for empty lists #5762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, the gate is especially appreciated. Unfortunately some changes are needed
I like this spring cleaning! |
These changes passed the BST+BVT test suites, undrafting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Reading through the diff highlights a few smaller changes worth doing within the vicinity of these changes (anti-patterns seem to clump together and cleanups tend to cascade) at a later date. Perhaps we ought to have an internal page specifically tracking these kinds of incremental cleanups?
I would avoid creating an internal page and rather create a ticket and use labels to find them again. Or start with a single ticket to collect them and from there create sub-tickets once they are worked on. |
Ah, yeah.. probably a better idea than throwing them into the Confluence abyss. |
8f8341c
to
72784d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash the commits before merging
Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
72784d9
to
845ffdd
Compare
Instead of traversing the entire list just to check if the first element is present, do that directly.
OCaml 5.1 has
List.is_empty
, here a simplelst = []
is used along with match statements.Adds a quality gate to check that we don't add trivially unnecessary cases like this anymore.