Skip to content

Replace simple return if statements with ternary operators - #21672

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:more-ternary
Jul 31, 2026
Merged

Replace simple return if statements with ternary operators#21672
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:more-ternary

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

In a couple of cases, where a boolean is returned, it's also possible to use an OR operator rather a ternary.

Note: This patch reduces the size of the gulp mozcentral bundle by 960 bytes.

In a couple of cases, where a boolean is returned, it's also possible to use an OR operator rather a ternary.

*Note:* This patch reduces the size of the `gulp mozcentral` bundle by `960` bytes.
@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.00%. Comparing base (ce4ff55) to head (ee59db5).

Files with missing lines Patch % Lines
src/core/xfa/xfa_object.js 71.42% 2 Missing ⚠️
src/pdf.sandbox.external.js 0.00% 2 Missing ⚠️
src/display/editor/alt_text.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21672      +/-   ##
==========================================
+ Coverage   89.97%   90.00%   +0.02%     
==========================================
  Files         263      263              
  Lines       66901    66859      -42     
==========================================
- Hits        60196    60175      -21     
+ Misses       6705     6684      -21     
Flag Coverage Δ
browsertest 66.56% <69.23%> (+0.02%) ⬆️
fonttest 9.04% <14.28%> (+<0.01%) ⬆️
integrationtest 69.34% <67.85%> (+0.01%) ⬆️
unittest 57.84% <53.57%> (+<0.01%) ⬆️
unittestcli 56.58% <57.69%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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 browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/a59b5775852b0f9/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/5eebb7b77c52b09/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/5eebb7b77c52b09/output.txt

Total script time: 18.02 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/a59b5775852b0f9/output.txt

Total script time: 23.27 mins

  • Regression tests: Passed

@timvandermeij
timvandermeij merged commit bb1a948 into mozilla:master Jul 31, 2026
21 checks passed
@timvandermeij

Copy link
Copy Markdown
Collaborator

Looks good; thank you for doing this!

@Snuffleupagus
Snuffleupagus deleted the more-ternary branch August 1, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants