Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little improves in CString new when creating from slice #92124

Merged
merged 1 commit into from
Jan 19, 2022
Merged

Little improves in CString new when creating from slice #92124

merged 1 commit into from
Jan 19, 2022

Commits on Dec 27, 2021

  1. 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.
    AngelicosPhosphoros committed Dec 27, 2021
    Configuration menu
    Copy the full SHA
    4b62a77 View commit details
    Browse the repository at this point in the history