From: Eric Wong Date: Mon, 28 Apr 2014 10:55:59 +0000 (+0000) Subject: feed: dead code elimination around dropped endpoints X-Git-Tag: v1.0.0~1189 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=5adf8d639e9b5abd4cbac975d70ddc0fb76541fc feed: dead code elimination around dropped endpoints public-inbox is for discussion, so top-level posts do not get special treatment. --- diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 8d5648ed..1c6d1efd 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -22,7 +22,6 @@ sub generate { require PublicInbox::View; require POSIX; my $max = $args->{max} || MAX_PER_PAGE; - my $top = $args->{top}; # bool local $ENV{GIT_DIR} = $args->{git_dir}; my $feed_opts = get_feedopts($args); @@ -43,7 +42,7 @@ sub generate { my $git = try_git_pm($args->{git_dir}); each_recent_blob($args, sub { my ($add) = @_; - add_to_feed($feed_opts, $feed, $add, $top, $git); + add_to_feed($feed_opts, $feed, $add, $git); }); $feed->as_string; } @@ -53,7 +52,6 @@ sub generate_html_index { require Mail::Thread; my $max = $args->{max} || MAX_PER_PAGE; - my $top = $args->{top}; # bool local $ENV{GIT_DIR} = $args->{git_dir}; my $feed_opts = get_feedopts($args); @@ -63,12 +61,7 @@ sub generate_html_index { my @messages; my $git = try_git_pm($args->{git_dir}); my $last = each_recent_blob($args, sub { - my $mime = do_cat_mail($git, $_[0]) - or return 0; - if ($top && ($mime->header('In-Reply-To') || - $mime->header('References'))) { - return 0; - } + my $mime = do_cat_mail($git, $_[0]) or return 0; $mime->body_set(''); # save some memory my $t = eval { str2time($mime->header('Date')) }; @@ -241,13 +234,9 @@ sub feed_date { # returns 0 (skipped) or 1 (added) sub add_to_feed { - my ($feed_opts, $feed, $add, $top, $git) = @_; + my ($feed_opts, $feed, $add, $git) = @_; my $mime = do_cat_mail($git, $add) or return 0; - if ($top && $mime->header('In-Reply-To')) { - return 0; - } - my $midurl = $feed_opts->{midurl} || 'http://example.com/m/'; my $fullurl = $feed_opts->{fullurl} || 'http://example.com/f/';