-
Notifications
You must be signed in to change notification settings - Fork 784
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
Change max/min string macro to generic helper function min_max_helper #2658
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.
❤️
.map(|i| unsafe { array.value_unchecked(i) }) | ||
.reduce(|acc, item| if cmp(&acc, &item) { item } else { acc }) | ||
} else { | ||
let iter = ArrayIter::new(array); |
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.
It might be faster to use BitIndexIterator
here, something potentially for a future PR
} | ||
} | ||
Some(n) | ||
min_max_helper::<T::Native, _, _>(array, |a, b| (!is_nan(*a) & is_nan(*b)) || a < b) |
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.
It occurs to me that this should probably be using the same total_cmp as the sort logic. Again not something for this PR
Thank you @tustvold. For the two points, I will address them in future PRs. |
Benchmark runs are scheduled for baseline = 613b66b and contender = 463240a. 463240a is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #2657.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?