gitweb: Use capturing parentheses only when you intend to capture
authorJakub Narebski <jnareb@gmail.com>
Mon, 11 May 2009 17:39:43 +0000 (19:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 May 2009 17:34:11 +0000 (10:34 -0700)
Non-capturing groups are useful because they have better runtime
performance and do not copy strings to the magic global capture
variables.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl

index beb79eebd5c1bba2fdb57445c0f674e277524a6e..097bd18be5de0b52eed7c879e6bdfb3968143712 100755 (executable)
@@ -828,7 +828,7 @@ if (!defined $action) {
 if (!defined($actions{$action})) {
        die_error(400, "Unknown action");
 }
-if ($action !~ m/^(opml|project_list|project_index)$/ &&
+if ($action !~ m/^(?:opml|project_list|project_index)$/ &&
     !$project) {
        die_error(400, "Project needed");
 }