зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678506 - Optimize UrlbarPrefs.get by calling only map.get and not map.has. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D97713
This commit is contained in:
Родитель
e6cc468b9a
Коммит
62f3b20e9d
|
@ -287,10 +287,12 @@ class Preferences {
|
|||
* @returns {*} The preference value.
|
||||
*/
|
||||
get(pref) {
|
||||
if (!this._map.has(pref)) {
|
||||
this._map.set(pref, this._getPrefValue(pref));
|
||||
let value = this._map.get(pref);
|
||||
if (value === undefined) {
|
||||
value = this._getPrefValue(pref);
|
||||
this._map.set(pref, value);
|
||||
}
|
||||
return this._map.get(pref);
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче