Skip to content

Commit

Permalink
Auto merge of #31057 - bluss:memrchr-fallback, r=alexcrichton
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jan 21, 2016
2 parents 34b4e66 + 078a623 commit 038de0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/memchr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 038de0f

Please sign in to comment.