about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-19 10:42:15 +0100
committerGitHub <noreply@github.com>2022-01-19 10:42:15 +0100
commit3148a322d87a2ba39da28f05b7d26ecac015c607 (patch)
tree9f269dbcc4c607a67c2d21f062e58c2c68388d35 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parent3a1db90efbdb66663e93e0943a594d1a44f5aedf (diff)
parent4b62a77e4d76f2f29cd46812e6d7400636790723 (diff)
downloadrust-3148a322d87a2ba39da28f05b7d26ecac015c607.tar.gz
rust-3148a322d87a2ba39da28f05b7d26ecac015c607.zip
Rollup merge of #92124 - AngelicosPhosphoros:remove_extra_alloc_in_cstring_new_35838, r=Mark-Simulacrum
Little improves in CString `new` when creating from slice

Old code already contain optimization for cases with `&str` and `&[u8]` args. This commit adds a specialization for `&mut[u8]` too.

Also, I added usage of old slice in search for zero bytes instead of new buffer because it produce better code for constant inputs on Windows LTO builds. For other platforms, this wouldn't cause any difference because it calls `libc` anyway.

Inlined `_new` method into spec trait to reduce amount of code generated to `CString::new` callers.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions