Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- my &cmp := &by.arity == 2 ?? &by !! { $^a cmp $^b };
- my Bool $is-initialized = False;
- for @values {
- if $is-initialized {
- $min = $_ if cmp($_, $min) < 0;
- } else {
- if .defined {
- $min = $_;
- $is-initialized = True;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement