Corrected fors in dbrequests.js

This commit is contained in:
Thomas FORGIONE 2015-10-06 09:18:17 +02:00
parent 2d02cc177d
commit 5faff4c1b4
1 changed files with 14 additions and 7 deletions

View File

@ -271,7 +271,8 @@ DBReq.Info.prototype.loadCoins = function() {
Log.dberror(err + ' in loadCoins'); Log.dberror(err + ' in loadCoins');
} else { } else {
self.results.coins = []; self.results.coins = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.coins.push( self.results.coins.push(
{ {
type: 'coin', type: 'coin',
@ -301,7 +302,8 @@ DBReq.Info.prototype.loadArrows = function() {
Log.dberror(err + ' in loadArrows'); Log.dberror(err + ' in loadArrows');
} else { } else {
self.results.arrows = []; self.results.arrows = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.arrows.push( self.results.arrows.push(
{ {
type: 'arrow', type: 'arrow',
@ -331,7 +333,8 @@ DBReq.Info.prototype.loadResets = function() {
Log.dberror(err + ' in loadResets'); Log.dberror(err + ' in loadResets');
} else { } else {
self.results.resets = []; self.results.resets = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.resets.push( self.results.resets.push(
{ {
type: 'reset', type: 'reset',
@ -367,7 +370,8 @@ DBReq.Info.prototype.loadPreviousNext = function () {
Log.dberror(err + ' in loadPreviousNext'); Log.dberror(err + ' in loadPreviousNext');
} else { } else {
self.results.previousNext = []; self.results.previousNext = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.previousNext.push( self.results.previousNext.push(
{ {
type: 'previousnext', type: 'previousnext',
@ -407,7 +411,8 @@ DBReq.Info.prototype.loadHovered = function() {
Log.dberror(err + ' in loadHovered'); Log.dberror(err + ' in loadHovered');
} else { } else {
self.results.hovered = []; self.results.hovered = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.hovered.push( self.results.hovered.push(
{ {
type: "hovered", type: "hovered",
@ -438,7 +443,8 @@ DBReq.Info.prototype.loadPointerLocked = function() {
Log.dberror(err + ' in loadPointerLocked'); Log.dberror(err + ' in loadPointerLocked');
} else { } else {
self.results.pointerlocked = []; self.results.pointerlocked = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.pointerlocked.push( self.results.pointerlocked.push(
{ {
type: "pointerlocked", type: "pointerlocked",
@ -468,7 +474,8 @@ DBReq.Info.prototype.loadSwitchedLockOption = function() {
Log.dberror(err + ' in loadSwitchedLockOption'); Log.dberror(err + ' in loadSwitchedLockOption');
} else { } else {
self.results.switchedlockoption = []; self.results.switchedlockoption = [];
for (var i in result.rows) { var i = 0;
for (; i < result.rows.length; i++) {
self.results.switchedlockoption.push( self.results.switchedlockoption.push(
{ {
type: "switchedlockoption", type: "switchedlockoption",