1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Add general iteration support in the RefSet and RefSetCache classes

This patch removes the existing `forEach` methods, in favor of making the classes properly iterable instead. Given that the classes are using a `Set` respectively a `Map` internally, implementing this is very easy/efficient and allows us to simplify some existing code.
This commit is contained in:
Jonas Jenwald 2022-03-18 14:18:03 +01:00
parent 489e9ff7d3
commit c0736647f9
5 changed files with 54 additions and 60 deletions

View file

@ -179,9 +179,9 @@ class GlobalImageCache {
get _byteSize() {
let byteSize = 0;
this._imageCache.forEach(imageData => {
for (const imageData of this._imageCache) {
byteSize += imageData.byteSize;
});
}
return byteSize;
}