don't store match group lines twice

This commit is contained in:
Robin Appelman 2025-03-26 00:08:19 +01:00
commit 2f3e2325df
5 changed files with 10 additions and 13 deletions

View file

@ -27,7 +27,7 @@ pub fn footer<'a>(app: &App<'a>, params: FooterParams<'a>) -> Table<'a> {
Table::new(
[Row::new([
Text::from(help(page)),
Text::from(format!("{} unmatched items", app.unmatched.lines.len())),
Text::from(format!("{} unmatched items", app.unmatched.count())),
Text::from(format!("{} parse errors", app.error_count)),
])],
widths,

View file

@ -30,7 +30,7 @@ pub fn match_list<'a>(app: &'a App<'a>, filter: &Filter) -> ScrollbarTable<'a> {
];
let all = log_row(&app.all, app, "All lines");
let unmatched = if app.unmatched.lines.is_empty() {
let unmatched = if app.unmatched.count() == 0 {
Either::Right(empty())
} else {
Either::Left(once(log_row(&app.unmatched, app, "Unmatched lines")))

View file

@ -38,7 +38,7 @@ pub fn grouped_lines<'a>(
Text::from(""),
Text::from(""),
Text::from(log_match.sparkline.as_str()),
Text::from(log_match.lines.len().to_string()),
Text::from(log_match.count().to_string()),
]))
.chain(
grouped