Removed useless variable

This commit is contained in:
Thomas FORGIONE 2015-05-22 18:36:38 +02:00
parent 233079ec2e
commit b05ed54738
1 changed files with 3 additions and 4 deletions

View File

@ -51,26 +51,25 @@ Info.prototype.tryMerge = function() {
this.finishAction(this.finalResult);
}
// Merges the results of every SQL requests done by the load... methods
Info.prototype.merge = function() {
this.finalResult = [];
for (;;) {
// Find next element
var nextElement = null;
var nextIndex = null;
for (var i in this.results) {
// The next element is placed at the index 0 (since the elements
// gotten from the database are sorted)
if (this.results[i].length !== 0 &&
(nextElement === null || this.results[i][0].time < nextElement.time)) {
nextElement = this.results[i][0];
(nextIndex === null || this.results[i][0].time < this.results[nextIndex][0].time)) {
nextIndex = i;
}
}
// If there is no next element, we're done
if (nextElement === null) {
if (nextIndex === null) {
break;
}