Permalink
Browse files

'for' loop corrected for better performances

  • Loading branch information...
bfontaine committed Feb 8, 2012
1 parent 4743e90 commit 89ccc957acaced22492653acf899adb1c9314125
Showing with 4 additions and 4 deletions.
  1. +3 −3 tinycon.js
  2. +1 −1 tinycon.min.js
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.

0 comments on commit 89ccc95

Please sign in to comment.