about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-31 15:55:13 +0000
committerbors <bors@rust-lang.org>2020-08-31 15:55:13 +0000
commit897ef3a0ec001b89fffe7125c20d6a6bb12fee6c (patch)
tree6c9682ceb1b40eca7b815b0d9ceef1c2e5d67b3a /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent1fd8636d2428658cf46df53fb4f445558689fd1c (diff)
parent8d3cf9237dcc9d4f2a7c0bde42dc133e60f51c7d (diff)
downloadrust-897ef3a0ec001b89fffe7125c20d6a6bb12fee6c.tar.gz
rust-897ef3a0ec001b89fffe7125c20d6a6bb12fee6c.zip
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
Get rid of bounds check in slice::chunks_exact() and related function…

…s during construction

LLVM can't figure out in

    let rem = self.len() % chunk_size;
    let len = self.len() - rem;
    let (fst, snd) = self.split_at(len);

and

    let rem = self.len() % chunk_size;
    let (fst, snd) = self.split_at(rem);

that the index passed to split_at() is smaller than the slice length and
adds a bounds check plus panic for it.

Apart from removing the overhead of the bounds check this also allows
LLVM to optimize code around the ChunksExact iterator better.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions