зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1300165 - Improves performance of combineLists in getHSTSPreloadList.js r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D38171 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d75e9f219f
Коммит
f723e0ab1e
|
@ -368,15 +368,14 @@ function readCurrentList(filename) {
|
|||
}
|
||||
|
||||
function combineLists(newHosts, currentHosts) {
|
||||
let newHostsSet = new Set();
|
||||
|
||||
for (let newHost of newHosts) {
|
||||
newHostsSet.add(newHost.name);
|
||||
}
|
||||
|
||||
for (let currentHost in currentHosts) {
|
||||
let found = false;
|
||||
for (let newHost of newHosts) {
|
||||
if (newHost.name == currentHost) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if (!newHostsSet.has(currentHost)) {
|
||||
newHosts.push({ name: currentHost, retries: MAX_RETRIES });
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче