Closed Bug 1081593 Opened 5 years ago Closed 5 years ago

Remove unnecessary ternary operations

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 36

People

(Reporter: ckitching, Assigned: ckitching)

Details

Attachments

(1 file, 1 obsolete file)

Sometimes, we have ternary expressions where one of the output branches is a constant.

In a number of cases, it seems to aid readability if we rephrase using && or ||.
... See patch.

(This also produces a very, *very* binary size (and pre-JIT performance)  improvement)
Attached patch Clean up some ternary operators (obsolete) — Splinter Review
Attachment #8503701 - Flags: review?(rnewman)
Attachment #8503702 - Flags: review?(rnewman)
(In reply to Chris Kitching [:ckitching] from comment #0)
> (This also produces a very, *very* binary size (and pre-JIT performance) 
> improvement)

Should read "(This also produces a very, *very* tiny binary size (and pre-JIT performance) 
 improvement)"

.. A rather important word in context.
Attachment #8503701 - Attachment is obsolete: true
Attachment #8503701 - Flags: review?(rnewman)
Comment on attachment 8503702 [details] [diff] [review]
Clean up some ternary operators

Review of attachment 8503702 [details] [diff] [review]:
-----------------------------------------------------------------

Upstream plz.
Attachment #8503702 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/a95e2de845ff
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
You need to log in before you can comment on or make changes to this bug.