diff options
author | Eric Wong <e@yhbt.net> | 2020-04-04 08:03:17 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-04-04 23:37:15 +0000 |
commit | c3e6ffa858003c17e96ef90d13760bda194319e0 (patch) | |
tree | 4985211330ca0b70d3709b555e38e14b0af447e8 /lib/PublicInbox/View.pm | |
parent | f9b63d4cd4d5a58c37ed8464b2d335a6932cc118 (diff) | |
download | public-inbox-c3e6ffa858003c17e96ef90d13760bda194319e0.tar.gz |
While rare in practice (even by spammers), A single "0" could theoretically be the entire contents of a Subject line. So use the Perl 5.10+ defined-or operator to improve correctness of subject deduplication.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r-- | lib/PublicInbox/View.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 9ef1f68a..f0584cb7 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -888,20 +888,20 @@ sub missing_thread { sub dedupe_subject { my ($prev_subj, $subj, $val) = @_; - my $omit = ''; # '"' denotes identical text omitted + my $omit; # '"' denotes identical text omitted my (@prev_pop, @curr_pop); while (@$prev_subj && @$subj && $subj->[-1] eq $prev_subj->[-1]) { push(@prev_pop, pop(@$prev_subj)); push(@curr_pop, pop(@$subj)); - $omit ||= $val; + $omit //= $val; } pop @$subj if @$subj && $subj->[-1] =~ /^re:\s*/i; if (scalar(@curr_pop) == 1) { - $omit = ''; + $omit = undef; push @$prev_subj, @prev_pop; push @$subj, @curr_pop; } - $omit; + $omit // ''; } sub skel_dump { # walk_thread callback |