Skip to content

Commit

Permalink
fix websqlstore uses resultset insert for lookup result to avoid dupl…
Browse files Browse the repository at this point in the history
…icate values
  • Loading branch information
reyesr committed Sep 21, 2012
1 parent 199a198 commit 0dd7257
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stores/websql_store.js
Expand Up @@ -356,18 +356,18 @@ fullproof.store = fullproof.store||{};
this.db.transaction(function(tx) {
tx.executeSql("SELECT * FROM " + self.tableName + " WHERE id=? ORDER BY value ASC", [word],
function(tx,res) {
var result = [];
var result = new fullproof.ResultSet(self.comparatorObject);
for (var i=0; i<res.rows.length; ++i) {
var item = res.rows.item(i);
if (item) {
if (item.score === null || item.score === undefined || item.score === false) {
result.push(item.value);
result.insert(item.value);
} else {
result.push(new fullproof.ScoredEntry(item.id, item.value, item.score));
result.insert(new fullproof.ScoredEntry(item.id, item.value, item.score));
}
}
}
callback(new fullproof.ResultSet(self.comparatorObject).setDataUnsafe(result));
callback(result);
},
function() {
callback(false);
Expand Down

0 comments on commit 0dd7257

Please sign in to comment.