From 49338dea67712c0106c09d871fca7d680c32298f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 6 Jul 2015 21:22:22 +0000 Subject: feed: compile regexps only once This avoids some runtime penalties associated with recompiling a regexp based on a constant local variable. --- lib/PublicInbox/Feed.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index dd991532..3c0ec86d 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -168,14 +168,14 @@ sub each_recent_blob { } } elsif ($line =~ /$delmsg/o) { $deleted{$1} = 1; - } elsif ($line =~ /^commit (${hex}{7,40})/) { + } elsif ($line =~ /^commit (${hex}{7,40})/o) { push @commits, $1; } } if ($last) { while (my $line = <$log>) { - if ($line =~ /^commit (${hex}{7,40})/) { + if ($line =~ /^commit (${hex}{7,40})/o) { push @commits, $1; last; } -- cgit v1.2.3-24-ge0c7