Reviewers: Lasse Reichstein,

Description:
Minor optimization in regexp parse.

Please review this at http://codereview.chromium.org/6014002/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/parser.cc


Index: src/parser.cc
===================================================================
--- src/parser.cc       (revision 6079)
+++ src/parser.cc       (working copy)
@@ -3730,7 +3730,7 @@
     contains_anchor_(false),
     is_scanned_for_captures_(false),
     failed_(false) {
-  Advance(1);
+  Advance();
 }


@@ -3768,8 +3768,8 @@


 void RegExpParser::Advance(int dist) {
-  for (int i = 0; i < dist; i++)
-    Advance();
+  next_pos_ += dist - 1;
+  Advance();
 }




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to