Skip to content

Avoid resolving an objId more than once in the PDFObjects class#20944

Merged
timvandermeij merged 2 commits intomozilla:masterfrom
Snuffleupagus:PDFObjects-resolve-once
Mar 22, 2026
Merged

Avoid resolving an objId more than once in the PDFObjects class#20944
timvandermeij merged 2 commits intomozilla:masterfrom
Snuffleupagus:PDFObjects-resolve-once

Conversation

@Snuffleupagus
Copy link
Copy Markdown
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 22, 2026

Trying to resolve the same objId more than once would be a bug elsewhere in the code-base, since that should never happen, hence update the resolve method to prevent that.

Trying to resolve the same `objId` more than once would be a bug elsewhere in the code-base, since that should never happen, hence update the `resolve` method to prevent that.
With the introduction of `Map.prototype.getOrInsertComputed()` usage this method is no longer necessary, and the code can just be inlined instead.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.61%. Comparing base (918a319) to head (e3564de).

Files with missing lines Patch % Lines
src/display/pdf_objects.js 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20944      +/-   ##
==========================================
+ Coverage   62.58%   62.61%   +0.03%     
==========================================
  Files         174      174              
  Lines      121930   121923       -7     
==========================================
+ Hits        76306    76344      +38     
+ Misses      45624    45579      -45     
Flag Coverage Δ
fonttest 7.66% <ø> (ø)
unittestcli 62.59% <60.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Snuffleupagus
Copy link
Copy Markdown
Collaborator Author

/botio-linux test

@moz-tools-bot
Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/16447f7951fd868/output.txt

Copy link
Copy Markdown
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, with passing tests. Thanks!

@moz-tools-bot
Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/16447f7951fd868/output.txt

Total script time: 45.72 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: Passed

@timvandermeij timvandermeij merged commit 1aa95d2 into mozilla:master Mar 22, 2026
15 checks passed
@Snuffleupagus Snuffleupagus deleted the PDFObjects-resolve-once branch March 22, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants