rustdoc-search: use ES6 Set
for deduplication instead of Object
This commit is contained in:
parent
e34dc7f437
commit
8642c96a33
@ -906,7 +906,7 @@ function initSearch(rawSearchIndex) {
|
|||||||
const results_others = {}, results_in_args = {}, results_returned = {};
|
const results_others = {}, results_in_args = {}, results_returned = {};
|
||||||
|
|
||||||
function transformResults(results) {
|
function transformResults(results) {
|
||||||
const duplicates = {};
|
const duplicates = new Set();
|
||||||
const out = [];
|
const out = [];
|
||||||
|
|
||||||
for (const result of results) {
|
for (const result of results) {
|
||||||
@ -919,10 +919,10 @@ function initSearch(rawSearchIndex) {
|
|||||||
// To be sure than it some items aren't considered as duplicate.
|
// To be sure than it some items aren't considered as duplicate.
|
||||||
obj.fullPath += "|" + obj.ty;
|
obj.fullPath += "|" + obj.ty;
|
||||||
|
|
||||||
if (duplicates[obj.fullPath]) {
|
if (duplicates.has(obj.fullPath)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
duplicates[obj.fullPath] = true;
|
duplicates.add(obj.fullPath);
|
||||||
|
|
||||||
obj.href = res[1];
|
obj.href = res[1];
|
||||||
out.push(obj);
|
out.push(obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user