Skip to content

Commit

Permalink
Merge pull request #19278 from Snuffleupagus/more-Dict-iteration
Browse files Browse the repository at this point in the history
Use `Dict` iteration more (PR 19051 follow-up)
  • Loading branch information
timvandermeij authored Jan 4, 2025
2 parents 7f5f4d0 + 74c1795 commit 3e82239
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/core/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,7 @@ class Catalog {
}
let prefs = null;

for (const key of obj.getKeys()) {
const value = obj.get(key);
for (const [key, value] of obj) {
let prefValue;

switch (key) {
Expand Down
4 changes: 1 addition & 3 deletions src/core/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -1472,9 +1472,7 @@ class PDFDocument {
return shadow(this, "documentInfo", docInfo);
}

for (const key of infoDict.getKeys()) {
const value = infoDict.get(key);

for (const [key, value] of infoDict) {
switch (key) {
case "Title":
case "Author":
Expand Down
3 changes: 1 addition & 2 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,7 @@ class PartialEvaluator {
// This array holds the converted/processed state data.
const gStateObj = [];
let promise = Promise.resolve();
for (const key of gState.getKeys()) {
const value = gState.get(key);
for (const [key, value] of gState) {
switch (key) {
case "Type":
break;
Expand Down

0 comments on commit 3e82239

Please sign in to comment.