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:
parent
039307f88c
commit
aff0d56326
1 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue