summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-12-02 05:59:57 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-02 07:05:42 -0800
commit194d4b4c00a783e5c4300e32d07ed963d493211d (patch)
treeb93858a37ace43b743a80097d1d25c3dbf977316 /theme
parentde49957a5277d8a5c3cce6623be8300e95e91c7f (diff)
downloadsubsurface-194d4b4c00a783e5c4300e32d07ed963d493211d.tar.gz
Variable should be declared before loop
Fixing incorrect variable scope. (I do not really see any functional differences on Firefox, but better declare the variable before the loop.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'theme')
-rw-r--r--theme/list_lib.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/theme/list_lib.js b/theme/list_lib.js
index e50fc3912..6fde5417c 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -431,10 +431,12 @@ function sort_it(sortOn, function_)
for (var j = 0; j < itemsToShow.length; j++) {
visited[j] = false;
}
+
+ var iSmaller;
for (var i = 0; i < itemsToShow.length; i++) {
for (var j = 0; j < itemsToShow.length; j++)
if (visited[j] === false)
- var iSmaller = j;
+ iSmaller = j;
for (var j = 0; j < itemsToShow.length; j++) {
if (function_(itemsToShow[j], itemsToShow[iSmaller])) {
if (visited[j] === false) {