[OpenLayers-Commits] r5165 - sandbox/ahocevar/sldRenderer/lib/OpenLayers

commits at openlayers.org commits at openlayers.org
Fri Nov 9 17:35:24 EST 2007


Author: ahocevar
Date: 2007-11-09 17:35:21 -0500 (Fri, 09 Nov 2007)
New Revision: 5165

Modified:
   sandbox/ahocevar/sldRenderer/lib/OpenLayers/BaseTypes.js
Log:
start loop at 1 instead of 0: improves performance, and the first token never needs to be replaced: if a string starts with "${", the first token will be empty.

Modified: sandbox/ahocevar/sldRenderer/lib/OpenLayers/BaseTypes.js
===================================================================
--- sandbox/ahocevar/sldRenderer/lib/OpenLayers/BaseTypes.js	2007-11-09 22:30:34 UTC (rev 5164)
+++ sandbox/ahocevar/sldRenderer/lib/OpenLayers/BaseTypes.js	2007-11-09 22:35:21 UTC (rev 5165)
@@ -112,7 +112,7 @@
         }
         var tokens = template.split("${");
         var last;
-        for(var i=0; i<tokens.length; i++) { 
+        for(var i=1; i<tokens.length; i++) { 
             var last = tokens[i].indexOf("}"); 
             if(last != -1) { 
                 tokens[i] = context[tokens[i].substring(0, last)] +



More information about the Commits mailing list