diff options
| author | bors <bors@rust-lang.org> | 2015-07-23 02:24:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-23 02:24:06 +0000 |
| commit | 8d91bbd90afeaf2e4b262cd48db7d29e9b8d1f49 (patch) | |
| tree | 6a4be3569dc037086052f168167b56343be33485 /src/libcore | |
| parent | cb4f102e38ef306e7e8e4ac747f25799b4cf7415 (diff) | |
| parent | 000e870554dd15c827389ce352166f67d9c51323 (diff) | |
| download | rust-8d91bbd90afeaf2e4b262cd48db7d29e9b8d1f49.tar.gz rust-8d91bbd90afeaf2e4b262cd48db7d29e9b8d1f49.zip | |
Auto merge of #27192 - dotdash:inline_eq_slice, r=luqmana
eq_slice_() used to be a common implementation for two function that both called it, but of those only eq_slice() is left, so we can as well directly inline the code.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/str/mod.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 5269cce1744..4f0b881c5cd 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -871,12 +871,12 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> { Section: Comparing strings */ -// share the implementation of the lang-item vs. non-lang-item -// eq_slice. +/// Bytewise slice equality /// NOTE: This function is (ab)used in rustc::middle::trans::_match /// to compare &[u8] byte slices that are not necessarily valid UTF-8. +#[lang = "str_eq"] #[inline] -fn eq_slice_(a: &str, b: &str) -> bool { +fn eq_slice(a: &str, b: &str) -> bool { // NOTE: In theory n should be libc::size_t and not usize, but libc is not available here #[allow(improper_ctypes)] extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; } @@ -887,15 +887,6 @@ fn eq_slice_(a: &str, b: &str) -> bool { } } -/// Bytewise slice equality -/// NOTE: This function is (ab)used in rustc::middle::trans::_match -/// to compare &[u8] byte slices that are not necessarily valid UTF-8. -#[lang = "str_eq"] -#[inline] -fn eq_slice(a: &str, b: &str) -> bool { - eq_slice_(a, b) -} - /* Section: Misc */ |
