'for' loop corrected for better performances #9

Merged
merged 1 commit into from Feb 8, 2012
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Split
View
@@ -44,7 +44,7 @@
var links = document.getElementsByTagName('link');
- for(var i=0; i < links.length; i++) {
+ for(var i=0, len=links.length; i < len; i++) {
if (links[i].getAttribute('rel') === 'icon') {
return links[i];
}
@@ -58,7 +58,7 @@
var links = document.getElementsByTagName('link');
var head = document.getElementsByTagName('head')[0];
- for(var i=0; i < links.length; i++) {
+ for(var i=0, len=links.length; i < len; i++) {
if (links[i].getAttribute('rel') === 'icon') {
head.removeChild(links[i]);
}
@@ -225,4 +225,4 @@
Tinycon.setOptions(defaults);
window.Tinycon = Tinycon;
-})();
+})();
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.