* [PATCH] feed: compile regexps only once
@ 2015-07-06 21:22 Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-07-06 21:22 UTC (permalink / raw)
To: meta; +Cc: Eric Wong
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(-)
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index bcca24c..47dd48d 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -153,14 +153,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;
}
--
EW
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] feed: compile regexps only once
@ 2015-07-14 20:59 Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-07-14 20:59 UTC (permalink / raw)
To: meta
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(-)
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index dd99153..3c0ec86 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;
}
--
EW
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-14 20:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-06 21:22 [PATCH] feed: compile regexps only once Eric Wong
-- strict thread matches above, loose matches on Subject: below --
2015-07-14 20:59 Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).