Use Set
This commit is contained in:
parent
886278b19d
commit
1f62dfa572
@ -153,11 +153,11 @@ class Database {
|
|||||||
this._validate();
|
this._validate();
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
const visited = {};
|
const visited = new Set();
|
||||||
const results = [];
|
const results = [];
|
||||||
const processRow = (row, index) => {
|
const processRow = (row, index) => {
|
||||||
if (titles.includes(row.dictionary) && !hasOwn(visited, row.id)) {
|
if (titles.includes(row.dictionary) && !visited.has(row.id)) {
|
||||||
visited[row.id] = true;
|
visited.add(row.id);
|
||||||
results.push(Database._createTerm(row, index));
|
results.push(Database._createTerm(row, index));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user