From a496150a9ed6d9400967739aeac00d401c42f7ea Mon Sep 17 00:00:00 2001 From: "sandholm@chromium.org" Date: Mon, 20 Dec 2010 10:44:41 +0000 Subject: [PATCH] Minor optimization in regexp parse. Review URL: http://codereview.chromium.org/6014002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6081 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/parser.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.cc b/src/parser.cc index 94ad57c..08f77b8 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -3730,7 +3730,7 @@ RegExpParser::RegExpParser(FlatStringReader* in, contains_anchor_(false), is_scanned_for_captures_(false), failed_(false) { - Advance(1); + Advance(); } @@ -3768,8 +3768,8 @@ void RegExpParser::Reset(int pos) { void RegExpParser::Advance(int dist) { - for (int i = 0; i < dist; i++) - Advance(); + next_pos_ += dist - 1; + Advance(); } -- 2.7.4