aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-15 12:31:11 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-22 14:37:10 -0500
commit1f62dfa572f2eff2a130ef5db7b12bdc2dc7db27 (patch)
tree1f141407978b00fa353e168d5acfbf16a63fdbc3
parent886278b19de3693f75bb6c7775da8db86a8dd008 (diff)
Use Set
-rw-r--r--ext/bg/js/database.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 453cf15f..db59f982 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -153,11 +153,11 @@ class Database {
this._validate();
const promises = [];
- const visited = {};
+ const visited = new Set();
const results = [];
const processRow = (row, index) => {
- if (titles.includes(row.dictionary) && !hasOwn(visited, row.id)) {
- visited[row.id] = true;
+ if (titles.includes(row.dictionary) && !visited.has(row.id)) {
+ visited.add(row.id);
results.push(Database._createTerm(row, index));
}
};