From c32390c437b4a09987c35dac33a8a37338866804 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 16 Jan 2014 10:02:08 -0700 Subject: [PATCH] Small oversights --- builds/4chan-X.user.js | 1 - builds/crx/script.js | 1 - src/General/Index.coffee | 6 ++---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 2c3c0c488..efdaf8e69 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2785,7 +2785,6 @@ sortOnTop: function(match) { var i, offset, threadRoot, _i, _len, _ref; offset = 0; - i = 0; _ref = Index.sortedNodes; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { threadRoot = _ref[i]; diff --git a/builds/crx/script.js b/builds/crx/script.js index fab976f9c..9fb7260a1 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2795,7 +2795,6 @@ sortOnTop: function(match) { var i, offset, threadRoot, _i, _len, _ref; offset = 0; - i = 0; _ref = Index.sortedNodes; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { threadRoot = _ref[i]; diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 4efda8098..e9ca91a98 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -415,10 +415,8 @@ Index = sortOnTop: (match) -> offset = 0 - i = 0 - for threadRoot, i in Index.sortedNodes - if match Get.threadFromRoot threadRoot - Index.sortedNodes.splice offset++, 0, Index.sortedNodes.splice(i, 1)[0] + for threadRoot, i in Index.sortedNodes when match Get.threadFromRoot threadRoot + Index.sortedNodes.splice offset++, 0, Index.sortedNodes.splice(i, 1)[0] return buildIndex: ->