mirror of
https://github.com/uutils/coreutils
synced 2024-12-16 00:02:50 +00:00
0e46d453b7
This follows the cut_bytes() approach of letting read_line() create a buffer and find the newline. read_line() guarantees our buffer is a string of utf8 characters. When writing out the bytes segment we need to make sure we are cutting on utf8 boundaries, there for we must iterate over the buffer from read_line(). This implementation is(/should be) efficient as it only iterates once over the buffer. The previous performance was about 4x as slow as cut_bytes() and now it is about 2x as slow as cut_bytes(). |
||
---|---|---|
.. | ||
cut.rs | ||
ranges.rs |