Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: src/regexp.js

Issue 2662002: Simplify criteria for doing an optimized test call (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp.js
===================================================================
--- src/regexp.js (revision 4799)
+++ src/regexp.js (working copy)
@@ -293,15 +293,12 @@
return cache.answer;
}
- // Remove irrelevant '.*' around a test regexp. The expression
- // checks whether this.source starts and ends with '.*' and that the third
- // char is not a '?' and that the third to last char is not a '\'.
+ // Remove irrelevant preceeding '.*' in a test regexp. The expression
+ // checks whether this.source starts with '.*' and that the third
+ // char is not a '?'
if (%_StringCharCodeAt(this.source,0) == 46 && // '.'
%_StringCharCodeAt(this.source,1) == 42 && // '*'
- %_StringCharCodeAt(this.source,2) != 63 && // '?'
- %_StringCharCodeAt(this.source,this.source.length - 3) != 28 && // '\'
- %_StringCharCodeAt(this.source,this.source.length - 2) == 46 && // '.'
- %_StringCharCodeAt(this.source,this.source.length - 1) == 42) { // '*'
+ %_StringCharCodeAt(this.source,2) != 63) { // '?'
if (!%_ObjectEquals(regexp_key, this)) {
regexp_key = this;
regexp_val = new $RegExp(this.source.substring(2,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698