Skip to content

Commit 038de0f

Browse files
committed
Auto merge of #31057 - bluss:memrchr-fallback, r=alexcrichton
Use the fallback impl for memrchr on non-linux The memrchr code was never used(!). This brings the memrchr improvements to non-linux platforms (LineWriter / buffered stdout benefits). Previous PR #30381
2 parents 34b4e66 + 078a623 commit 038de0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/memchr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> {
9898

9999
#[cfg(not(target_os = "linux"))]
100100
fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
101-
haystack.iter().rposition(|&b| b == needle)
101+
fallback::memrchr(needle, haystack)
102102
}
103103

104104
memrchr_specific(needle, haystack)

0 commit comments

Comments
 (0)