summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-21 13:31:43 +0000
committerbors <bors@rust-lang.org>2016-01-21 13:31:43 +0000
commit038de0f95e35acc6748aa305dff97dea7b814a1a (patch)
treee2cbf5f81e707d3c430af445025d47b6704fcf59 /src/libstd
parent34b4e66736a0fb65235feadbb5178d42bd09ed67 (diff)
parent078a6231a78a974eb19df884630edb8c65909941 (diff)
downloadrust-038de0f95e35acc6748aa305dff97dea7b814a1a.tar.gz
rust-038de0f95e35acc6748aa305dff97dea7b814a1a.zip
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
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/memchr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/memchr.rs b/src/libstd/memchr.rs
index c043b41ed21..27702e2e59a 100644
--- a/src/libstd/memchr.rs
+++ b/src/libstd/memchr.rs
@@ -98,7 +98,7 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> {
 
     #[cfg(not(target_os = "linux"))]
     fn memrchr_specific(needle: u8, haystack: &[u8]) -> Option<usize> {
-        haystack.iter().rposition(|&b| b == needle)
+        fallback::memrchr(needle, haystack)
     }
 
     memrchr_specific(needle, haystack)