about summary refs log tree commit diff
path: root/src/libcore/str
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-02-26 22:42:29 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-02-26 22:42:29 +0100
commit280e381b8d515a534c053b2bda83e5c6902c4a96 (patch)
treee6dd647276d4e4dcbe9209b341e5cbeca350bc96 /src/libcore/str
parentabc3073c92df034636a823c5382ece2186d22b9e (diff)
downloadrust-280e381b8d515a534c053b2bda83e5c6902c4a96.tar.gz
rust-280e381b8d515a534c053b2bda83e5c6902c4a96.zip
don't take redundant references to operands
Diffstat (limited to 'src/libcore/str')
-rw-r--r--src/libcore/str/pattern.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs
index ef64d8b0fdf..6c826e5dcde 100644
--- a/src/libcore/str/pattern.rs
+++ b/src/libcore/str/pattern.rs
@@ -1050,7 +1050,7 @@ impl TwoWaySearcher {
         // &v[..period]. If it is, we use "Algorithm CP1". Otherwise we use
         // "Algorithm CP2", which is optimized for when the period of the needle
         // is large.
-        if &needle[..crit_pos] == &needle[period..period + crit_pos] {
+        if needle[..crit_pos] == needle[period..period + crit_pos] {
             // short period case -- the period is exact
             // compute a separate critical factorization for the reversed needle
             // x = u' v' where |v'| < period(x).