diff options
| author | joboet <jonasboettiger@icloud.com> | 2024-12-09 13:27:06 +0100 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2024-12-09 13:27:06 +0100 |
| commit | 49d76b8d0e9d3647bbc26dce9fd50aab66ea0617 (patch) | |
| tree | 1d27ebd8ec49a2528bfca9916854a378a318e458 | |
| parent | 13c77ba34d16255d9f5a57758140c73a86f1895c (diff) | |
| download | rust-49d76b8d0e9d3647bbc26dce9fd50aab66ea0617.tar.gz rust-49d76b8d0e9d3647bbc26dce9fd50aab66ea0617.zip | |
core: use public method instead of instrinsic
| -rw-r--r-- | library/core/src/slice/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 191eaccff98..2bcea43d588 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -7,7 +7,7 @@ #![stable(feature = "rust1", since = "1.0.0")] use crate::cmp::Ordering::{self, Equal, Greater, Less}; -use crate::intrinsics::{exact_div, select_unpredictable, unchecked_sub}; +use crate::intrinsics::{exact_div, unchecked_sub}; use crate::mem::{self, SizedTypeProperties}; use crate::num::NonZero; use crate::ops::{Bound, OneSidedRange, Range, RangeBounds, RangeInclusive}; @@ -2835,7 +2835,7 @@ impl<T> [T] { // Binary search interacts poorly with branch prediction, so force // the compiler to use conditional moves if supported by the target // architecture. - base = select_unpredictable(cmp == Greater, base, mid); + base = (cmp == Greater).select_unpredictable(base, mid); // This is imprecise in the case where `size` is odd and the // comparison returns Greater: the mid element still gets included |
