]> git.lizzy.rs Git - rust.git/commitdiff
Merge #7224
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sun, 10 Jan 2021 09:34:24 +0000 (09:34 +0000)
committerGitHub <noreply@github.com>
Sun, 10 Jan 2021 09:34:24 +0000 (09:34 +0000)
7224: Remove unnecessary allocation when checking whether to hide argument name hint r=jhpratt a=jhpratt

The case-insensitive prefix/suffix check can be performed
character-by-character. This allows the check to be done without having
to allocate a new string. As a side effect, it's also no longer
necessary to convert the entire string to lowercase, as it's done as
needed. As the only case equality we're handling is ASCII, this
operation can be further optimized by using byte equality, rather than
character equality.

cc @SomeoneToIgnore, as it's an update on my PR from yesterday.

Co-authored-by: Jacob Pratt <jacob@jhpratt.dev>

Trivial merge