Remove an unnecessary RefSetCache.prototype.has()
call from GlobalImageCache.getData
We can simply attempt to get the data *directly*, and instead check the result, rather than first checking if it exists.
This commit is contained in:
parent
039307f88c
commit
aff0d56326
@ -107,11 +107,10 @@ class GlobalImageCache {
|
||||
}
|
||||
|
||||
getData(ref, pageIndex) {
|
||||
if (!this._refCache.has(ref)) {
|
||||
const pageIndexSet = this._refCache.get(ref);
|
||||
if (!pageIndexSet) {
|
||||
return null;
|
||||
}
|
||||
const pageIndexSet = this._refCache.get(ref);
|
||||
|
||||
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user