about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorAngelicosPhosphoros <xuzin.timur@gmail.com>2021-12-20 15:57:47 +0300
committerAngelicosPhosphoros <xuzin.timur@gmail.com>2021-12-27 12:26:30 +0300
commit4b62a77e4d76f2f29cd46812e6d7400636790723 (patch)
tree0d1e50b7ffcfcf153d606f271eb6cba7bd29ca03 /src/test/codegen/src-hash-algorithm
parent8f540619007c1aa62dfc915409d881f52f21dc84 (diff)
downloadrust-4b62a77e4d76f2f29cd46812e6d7400636790723.tar.gz
rust-4b62a77e4d76f2f29cd46812e6d7400636790723.zip
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 Windows on 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')
0 files changed, 0 insertions, 0 deletions