1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 16:34:11 +01:00

Get rid of most remaining comprehensions.

This commit is contained in:
Kris Maglione
2015-12-20 15:53:43 -08:00
parent 0aba8fb619
commit 916ea412a5
34 changed files with 372 additions and 256 deletions

View File

@@ -350,11 +350,20 @@ var History = Module("history", {
};
// FIXME: Schema-specific
context.generate = () => [
Array.slice(row.rev_host).reverse().join("").slice(1)
for (row of iter(services.history.DBConnection
.createStatement("SELECT DISTINCT rev_host FROM moz_places WHERE rev_host IS NOT NULL;")))
].slice(2);
context.generate = () => {
// FIXME: Synchronous.
let statement = services.history.DBConnection
.createStatement(`SELECT DISTINCT rev_host FROM moz_places
WHERE rev_host IS NOT NULL;`);
let result = Array.from(iter(statement),
({ rev_host }) => Array.from(rev_host)
.reverse().join("")
.slice(1));
statement.finalize();
return result.slice(2); // Why slice 2?;
};
};
completion.history = function _history(context, maxItems, sort) {