1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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:
Jonas Jenwald 2020-06-07 11:56:04 +02:00
parent 039307f88c
commit aff0d56326

View file

@ -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;
}