diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2021-01-09 21:36:38 -0500 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2021-01-09 21:36:38 -0500 |
| commit | bd8a9035481ff2c349a36471c8c7c3533c3385c3 (patch) | |
| tree | 1f553b31f0e6c9505f6ef864a8c2baad10024b1a /docs/dev | |
| parent | bcb9ae18de1fa405eb2add56409ae264267607bb (diff) | |
| download | rust-bd8a9035481ff2c349a36471c8c7c3533c3385c3.tar.gz rust-bd8a9035481ff2c349a36471c8c7c3533c3385c3.zip | |
Remove unnecessary allocation
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.
Diffstat (limited to 'docs/dev')
0 files changed, 0 insertions, 0 deletions
