Skip to content

Commit

Permalink
Eliminate free calls of static methods
Browse files Browse the repository at this point in the history
This was caught by a newer compiler release.  These were missed in the
last audit we did before releasing v2.5.0.

Change-Id: I4abd29e965c95b56eb83c61294f8a7dbaacae990
  • Loading branch information
joeyparrish committed May 8, 2019
1 parent 01f7af9 commit 189902b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
11 changes: 4 additions & 7 deletions lib/media/adaptation_set_criteria.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,14 @@ shaka.media.PreferenceBasedCriteria = class {
*/
static filterByLanguage_(variants, preferredLanguage) {
const LanguageUtils = shaka.util.LanguageUtils;
const findClosestLocale = LanguageUtils.findClosestLocale;
const getLocaleForVariant = LanguageUtils.getLocaleForVariant;
const normalize = LanguageUtils.normalize;

/** @type {string} */
const preferredLocale = normalize(preferredLanguage);
const preferredLocale = LanguageUtils.normalize(preferredLanguage);

/** @type {?string} */
const closestLocale = findClosestLocale(
const closestLocale = LanguageUtils.findClosestLocale(
preferredLocale,
variants.map((variant) => getLocaleForVariant(variant)));
variants.map((variant) => LanguageUtils.getLocaleForVariant(variant)));

// There were no locales close to what we preferred.
if (!closestLocale) {
Expand All @@ -181,7 +178,7 @@ shaka.media.PreferenceBasedCriteria = class {

// Find the variants that use the closest variant.
return variants.filter((variant) => {
return closestLocale == getLocaleForVariant(variant);
return closestLocale == LanguageUtils.getLocaleForVariant(variant);
});
}

Expand Down
6 changes: 3 additions & 3 deletions lib/net/networking_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ shaka.net.NetworkingEngine.prototype.destroy = function() {
* @export
*/
shaka.net.NetworkingEngine.prototype.request = function(type, request) {
const cloneObject = shaka.util.ObjectUtils.cloneObject;
const ObjectUtils = shaka.util.ObjectUtils;
const numBytesRemainingObj =
new shaka.net.NetworkingEngine.NumBytesRemainingClass();

Expand Down Expand Up @@ -336,9 +336,9 @@ shaka.net.NetworkingEngine.prototype.request = function(type, request) {
request.method = request.method || 'GET';
request.headers = request.headers || {};
request.retryParameters = request.retryParameters ?
cloneObject(request.retryParameters) :
ObjectUtils.cloneObject(request.retryParameters) :
shaka.net.NetworkingEngine.defaultRetryParameters();
request.uris = cloneObject(request.uris);
request.uris = ObjectUtils.cloneObject(request.uris);

// Apply the registered filters to the request.
const requestFilterOperation = this.filterRequest_(type, request);
Expand Down

0 comments on commit 189902b

Please sign in to comment.