W3C home > Mailing lists > Public > www-validator-cvs@w3.org > March 2008

2002/css-validator/org/w3c/css/parser/analyzer CssParser.jj,1.41,1.42

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 28 Mar 2008 15:44:30 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JfGko-0007Sj-C4@lionel-hutz.w3.org>

Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv28662

Modified Files:
	CssParser.jj 
Log Message:
small optim, don't do the job if unneeded in convertStringIndex


Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- CssParser.jj	28 Mar 2008 15:39:12 -0000	1.41
+++ CssParser.jj	28 Mar 2008 15:44:27 -0000	1.42
@@ -2062,10 +2062,13 @@
 
 JAVACODE
 String convertStringIndex(String s, int start, int len, boolean escapeFirst) {
-    StringBuilder buf = new StringBuilder(len);
     int index = start;
     int t;
     int maxCount = 0;
+    if ((start == 0) && (len == s.length()) && (s.indexOf('\\') == -1)) {
+	return s;
+    }
+    StringBuilder buf = new StringBuilder(len);
 
     while (index < len) {
 	char c = s.charAt(index);
Received on Friday, 28 March 2008 15:45:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:00 GMT