From 217ea28a58a3e4ad586be51440988ee230d63f6e Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:36:12 -0400 Subject: [PATCH] `chore`: add comment and TODO for non-allocating to_lowercase_into helper that we're using in `frequency` [skip ci] --- src/cmd/frequency.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/frequency.rs b/src/cmd/frequency.rs index e89093c3c..2cef402db 100644 --- a/src/cmd/frequency.rs +++ b/src/cmd/frequency.rs @@ -253,6 +253,10 @@ impl Args { } } +/// this is a non-allocating to_lowercase that uses an existing buffer +/// and should be faster than the stdlib version +/// TODO: if this proves to be faster per the benchmarks, we should use +/// this project-wide over the allocating stdlib version, and move it to utils.rs #[inline] fn to_lowercase_into(s: &str, buf: &mut String) { buf.clear();