mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Replace promise.all with for loop for performance reasons (#7582)
This commit is contained in:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user