mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3998 from sylvestre/wc-doc
wc: document the long match
This commit is contained in:
commit
436b7006f2
1 changed files with 19 additions and 1 deletions
|
@ -317,6 +317,7 @@ fn word_count_from_reader<T: WordCountable>(
|
|||
// Specialize scanning loop to improve the performance.
|
||||
(false, false, false, false, false) => unreachable!(),
|
||||
|
||||
// show_bytes
|
||||
(true, false, false, false, false) => {
|
||||
// Fast path when only show_bytes is true.
|
||||
let (bytes, error) = count_bytes_fast(&mut reader);
|
||||
|
@ -330,58 +331,75 @@ fn word_count_from_reader<T: WordCountable>(
|
|||
}
|
||||
|
||||
// Fast paths that can be computed without Unicode decoding.
|
||||
// show_lines
|
||||
(false, false, true, false, false) => {
|
||||
count_bytes_chars_and_lines_fast::<_, false, false, true>(&mut reader)
|
||||
}
|
||||
// show_chars
|
||||
(false, true, false, false, false) => {
|
||||
count_bytes_chars_and_lines_fast::<_, false, true, false>(&mut reader)
|
||||
}
|
||||
// show_chars, show_lines
|
||||
(false, true, true, false, false) => {
|
||||
count_bytes_chars_and_lines_fast::<_, false, true, true>(&mut reader)
|
||||
}
|
||||
// show_bytes, show_lines
|
||||
(true, false, true, false, false) => {
|
||||
count_bytes_chars_and_lines_fast::<_, true, false, true>(&mut reader)
|
||||
}
|
||||
// show_bytes, show_chars
|
||||
(true, true, false, false, false) => {
|
||||
count_bytes_chars_and_lines_fast::<_, true, true, false>(&mut reader)
|
||||
}
|
||||
// show_bytes, show_chars, show_lines
|
||||
(true, true, true, false, false) => {
|
||||
count_bytes_chars_and_lines_fast::<_, true, true, true>(&mut reader)
|
||||
}
|
||||
|
||||
// show_words
|
||||
(_, false, false, false, true) => {
|
||||
word_count_from_reader_specialized::<_, false, false, false, true>(reader)
|
||||
}
|
||||
// show_max_line_length
|
||||
(_, false, false, true, false) => {
|
||||
word_count_from_reader_specialized::<_, false, false, true, false>(reader)
|
||||
}
|
||||
// show_max_line_length, show_words
|
||||
(_, false, false, true, true) => {
|
||||
word_count_from_reader_specialized::<_, false, false, true, true>(reader)
|
||||
}
|
||||
// show_chars, show_words
|
||||
(_, false, true, false, true) => {
|
||||
word_count_from_reader_specialized::<_, false, true, false, true>(reader)
|
||||
}
|
||||
// show_chars, show_lines
|
||||
(_, false, true, true, false) => {
|
||||
word_count_from_reader_specialized::<_, false, true, true, false>(reader)
|
||||
}
|
||||
// show_lines, show_max_line_length, show_words
|
||||
(_, false, true, true, true) => {
|
||||
word_count_from_reader_specialized::<_, false, true, true, true>(reader)
|
||||
}
|
||||
// show_chars, show_words
|
||||
(_, true, false, false, true) => {
|
||||
word_count_from_reader_specialized::<_, true, false, false, true>(reader)
|
||||
}
|
||||
// show_chars, show_max_line_length
|
||||
(_, true, false, true, false) => {
|
||||
word_count_from_reader_specialized::<_, true, false, true, false>(reader)
|
||||
}
|
||||
// show_chars, show_max_line_length, show_words
|
||||
(_, true, false, true, true) => {
|
||||
word_count_from_reader_specialized::<_, true, false, true, true>(reader)
|
||||
}
|
||||
// show_chars, show_lines, show_words
|
||||
(_, true, true, false, true) => {
|
||||
word_count_from_reader_specialized::<_, true, true, false, true>(reader)
|
||||
}
|
||||
// show_chars, show_lines, show_max_line_length
|
||||
(_, true, true, true, false) => {
|
||||
word_count_from_reader_specialized::<_, true, true, true, false>(reader)
|
||||
}
|
||||
// show_chars, show_lines, show_max_line_length, show_words
|
||||
(_, true, true, true, true) => {
|
||||
word_count_from_reader_specialized::<_, true, true, true, true>(reader)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue