From 1f62dfa572f2eff2a130ef5db7b12bdc2dc7db27 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 15 Feb 2020 12:31:11 -0500 Subject: [PATCH] Use Set --- ext/bg/js/database.js | 6 +++--- 1 file 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)); } };