Skip to content

Use iterators a little bit more, to avoid creating temporary Arrays#20835

Merged
Snuffleupagus merged 2 commits intomozilla:masterfrom
Snuffleupagus:return-iterators
Mar 9, 2026
Merged

Use iterators a little bit more, to avoid creating temporary Arrays#20835
Snuffleupagus merged 2 commits intomozilla:masterfrom
Snuffleupagus:return-iterators

Conversation

@Snuffleupagus
Copy link
Collaborator

No description provided.

…to return an iterator

This method is only used with loops, and it should be a tiny bit more efficient to use an iterator directly rather than first iterating through the underlying `Map` to create a temporary `Array` that we finally iterate through at the call-site.
…ator

This method is only used with loops, and it should be a tiny bit more efficient to use an iterator directly rather than first iterating through the underlying data to create a temporary `Array` that we finally iterate through at the call-site.

*Please note:* As port of these changes the chars/glyph caches, on the `Font` instances, are changed to use `Map`s rather than Objects.
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.72%. Comparing base (cc680f6) to head (dbb6ffb).

Files with missing lines Patch % Lines
src/core/fonts.js 90.90% 1 Missing ⚠️
src/display/annotation_layer.js 0.00% 1 Missing ⚠️
src/display/editor/annotation_editor_layer.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20835      +/-   ##
==========================================
+ Coverage   62.68%   62.72%   +0.04%     
==========================================
  Files         169      169              
  Lines      120476   120478       +2     
==========================================
+ Hits        75521    75573      +52     
+ Misses      44955    44905      -50     
Flag Coverage Δ
fonttest 7.66% <22.22%> (?)
unittestcli 62.70% <76.92%> (+0.01%) ⬆️

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
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/0b944de8b35478d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/15228d130884e10/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/0b944de8b35478d/output.txt

Total script time: 44.45 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.241.84.105:8877/0b944de8b35478d/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/15228d130884e10/output.txt

Total script time: 72.16 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/15228d130884e10/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit 4bae676 into mozilla:master Mar 9, 2026
12 checks passed
@Snuffleupagus Snuffleupagus deleted the return-iterators branch March 9, 2026 19:07
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