Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
thanks for this PR! |
|
|
||
| /// The index `count` characters after `start`: bytes in the C locale or | ||
| /// for invalid UTF-8, characters otherwise, as for `-w`. | ||
| fn char_offset(&self, line: &[u8], start: usize, count: usize) -> usize { |
There was a problem hiding this comment.
key_end_index does the same C / utf-8 / invalid dance, could it just call char_offset(line, key_start, limit)? almost the same code twice
|
|
||
| #[uutests::wasi_ignore(NoLocaleData)] | ||
| #[test] | ||
| fn test_skip_chars_multibyte() { |
There was a problem hiding this comment.
could you please also add a case with -s and -w together, and one with invalid utf-8 (bytes fallback)?
|
Binary size comparison: |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
In a UTF-8 locale,
-s Nskipped N bytes instead of N characters, soprintf 'éxy\nABxy\n' | uniq -s 2 -ccomparedxywithxyand merged the two lines. GNU skips two characters and comparesywithxy.-snow counts characters the same way-walready does: characters for valid UTF-8 outside the C locale, bytes otherwise. The new test covers both locales and fails onmain.Closes #16661
AI disclosure: written with help from Claude Code.