-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: simplify and improve performance of parsing initData when deduping #5775
perf: simplify and improve performance of parsing initData when deduping #5775
Conversation
59b705a
to
d365049
Compare
Incremental code coverage: 100.00% |
for (const d of bothInitDatas) { | ||
if (typeof d !== 'string' && !initDataMap.has(d.keyId)) { | ||
initDataMap.set(d.keyId, d); | ||
} else if (typeof d === 'string' && !initDataMap.has(d)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I'm forgetting something. In what situations are we expecting the initData
array of the drm to contain a string instead of a shaka.extern.InitDataOverride
? The previous version of this code did not seem to account for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to take this into account as not doing so breaks one of the tests where there is indeed a string in initData which I reckoned there is a reason behind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. That's annoying. We shouldn't have tests like that.
In that case I'll approve this, and then just quickly go and make a PR to change those tests.
…ing (shaka-project#5775) This change simplifies code that parses initData in the `getCommonDrmInfos` method Co-authored-by: Ivan Kohut <ivan.kohut@lamin.ar>
This change simplifies code that parses initData in the
getCommonDrmInfos
method