user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] feed: compile regexps only once
@ 2015-07-14 20:59  7% Eric Wong
  0 siblings, 0 replies; 2+ results
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	[relevance 7%]

* [PATCH] feed: compile regexps only once
@ 2015-07-06 21:22  7% Eric Wong
  0 siblings, 0 replies; 2+ results
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	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-07-06 21:22  7% [PATCH] feed: compile regexps only once Eric Wong
2015-07-14 20:59  7% Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).