mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-23 01:48:13 +01:00
Improve backup export speed
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,11 @@ export function unicodeSlice(
|
||||
begin: number,
|
||||
end: number
|
||||
): string {
|
||||
// Optimization: whole string fits into the range, return as is
|
||||
if (begin === 0 && end >= input.length) {
|
||||
return input;
|
||||
}
|
||||
|
||||
// Until https://chromium-review.googlesource.com/c/v8/v8/+/4190519 is merged,
|
||||
// we should limit the input size to avoid allocating tons of memory.
|
||||
// This should be longer than any max length we'd expect to slice.
|
||||
|
||||
Reference in New Issue
Block a user