Remove unnecessary ternary operations

RESOLVED FIXED in Firefox 36

Status

()

Firefox for Android
General
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: ckitching, Assigned: ckitching)

Tracking

unspecified
Firefox 36
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
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)
(Assignee)

Comment 1

4 years ago
Created attachment 8503701 [details] [diff] [review]
Clean up some ternary operators
Attachment #8503701 - Flags: review?(rnewman)
(Assignee)

Comment 2

4 years ago
Created attachment 8503702 [details] [diff] [review]
Clean up some ternary operators
Attachment #8503702 - Flags: review?(rnewman)
(Assignee)

Comment 3

4 years ago
(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.
(Assignee)

Updated

4 years ago
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
You need to log in before you can comment on or make changes to this bug.