fix(dash): Fix performance regression (#4064)

See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210
This commit is contained in:
Álvaro Velad Galván
2022-03-25 21:56:38 +01:00
committed by GitHub
parent 89409cee3e
commit 298b60481d
6 changed files with 30 additions and 27 deletions
+2 -3
View File
@@ -74,9 +74,8 @@ shaka.util.Uint8ArrayUtils = class {
// byte.
const bytes = window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));
const result = new Uint8Array(bytes.length);
const enumerate = (it) => shaka.util.Iterables.enumerate(it);
for (const {i, item} of enumerate(bytes)) {
result[i] = item.charCodeAt(0);
for (let i = 0; i < bytes.length; ++i) {
result[i] = bytes.charCodeAt(i);
}
return result;
}