Permalink
Browse files

Merge pull request #9 from bfontaine/master

'for' loop corrected to increase performance
  • Loading branch information...
Tom Moor
Tom Moor committed Feb 8, 2012
2 parents 4743e90 + 89ccc95 commit d64dfa3c5bbf6927dcfcbd736b967d5b53a4a28b
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 d64dfa3

Please sign in to comment.