about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-04 08:03:17 +0000
committerEric Wong <e@yhbt.net>2020-04-04 23:37:15 +0000
commitc3e6ffa858003c17e96ef90d13760bda194319e0 (patch)
tree4985211330ca0b70d3709b555e38e14b0af447e8 /lib/PublicInbox/View.pm
parentf9b63d4cd4d5a58c37ed8464b2d335a6932cc118 (diff)
downloadpublic-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.pm8
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