Repository navigation
wc: consider word join identifier as a seperator by default - #16934
Saumya40-codes wants to merge 2 commits into
Conversation
8d4241b to
7cf4678
Compare
Merging this PR will improve performance by 6.44%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
| let mut in_word = false; | ||
| let mut current_len = 0; | ||
| let is_posixly_correct = *IS_POSIXLY_CORRECT; | ||
| let is_utf8 = SHOW_WORDS && locale_encoding() == Encoding::Utf8; |
There was a problem hiding this comment.
could be computed once in Settings, next to count_chars_as_bytes, no?
There was a problem hiding this comment.
yes, updated in the last commit.
Signed-off-by: Saumya Shah <saumyabshah90@gmail.com> wc: consider word joiner case only for utf-8 locales Signed-off-by: Saumya Shah <saumyabshah90@gmail.com>
Signed-off-by: Saumya Shah <saumyabshah90@gmail.com>
3434d10 to
29e6063
Compare
This PR treats the word joiner identifier U+2060 as a seperator by default for UTF-8 locales, unless POSIXLY_CORRECT=1 is set, which matches the behaviour for which I've also added the tests for this small patch.
Closes #16933