mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
Replace promise.all with for loop for performance reasons (#7582)
This commit is contained in:
parent
c4f19bdc6e
commit
842fa5153b
@ -155,7 +155,12 @@ export class EncryptServiceImplementation implements EncryptService {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return await Promise.all(items.map((item) => item.decrypt(key)));
|
// don't use promise.all because this task is not io bound
|
||||||
|
let results = [];
|
||||||
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
results.push(await items[i].decrypt(key));
|
||||||
|
}
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
async hash(value: string | Uint8Array, algorithm: "sha1" | "sha256" | "sha512"): Promise<string> {
|
async hash(value: string | Uint8Array, algorithm: "sha1" | "sha256" | "sha512"): Promise<string> {
|
||||||
|
Loading…
Reference in New Issue
Block a user