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

xapi-stdext-std: add Listext.List.find_minimum #85

Merged
merged 3 commits into from
Jan 17, 2024

Conversation

psafont
Copy link
Member

@psafont psafont commented Jan 16, 2024

Useful to get the lowest or highest element in a list in linear time, as it avoid sorting the whole list.

@psafont psafont force-pushed the changes branch 2 times, most recently from ef58d5e to 8950f7c Compare January 17, 2024 10:20
@duobei
Copy link

duobei commented Jan 17, 2024

Useful to get the lowest or highest element in a list in linear time, as it avoid sorting the whole list.

I'm not quite happy with the name having "first", but couldn't think of anything better

How about find_top_sorted ?

@psafont psafont force-pushed the changes branch 2 times, most recently from 484c848 to 4b4ccb2 Compare January 17, 2024 10:51
@psafont psafont changed the title xapi-stdext-std: add Listext.List.find_first_sorted xapi-stdext-std: add Listext.List.find_minimum Jan 17, 2024
lib/xapi-stdext-std/listext.mli Show resolved Hide resolved
Useful to get the lowest or highest element in a list in linear time, as
it avoids sorting the whole list.

Signed-off-by: Pau Ruiz Safont <[email protected]>
Signed-off-by: Pau Ruiz Safont <[email protected]>
@psafont psafont merged commit 4cf5cbe into xapi-project:master Jan 17, 2024
2 checks passed
@psafont psafont deleted the changes branch January 17, 2024 15:21
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.

4 participants