Closed Bug 1081401 Opened 10 years ago Closed 10 years ago

Don't manually box and unbox primitives when it's not useful

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 35

People

(Reporter: ckitching, Assigned: ckitching)

Details

Attachments

(1 file)

Just occasionally, you can improve performance by manually doing the boxing.

Not usually, though. Usually it just makes extra code (and if you explicitly construct objects, can make confusing semantics (where 3 does not necessarily equal 3) and more code)
Attachment #8503494 - Flags: review?(rnewman)
Comment on attachment 8503494 [details] [diff] [review]
Remove unnecessary autoboxing

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

This looks fine, assuming the changes were automatically performed by a system that has a very good understanding of Java's automatic boxing and coercion (and thus that it's true that e.g., an int will be boxed to an Integer to be returned from a method that returns an Object).

Note that all of the Sync/FxA/etc. stuff needs to be upstreamed.
Attachment #8503494 - Flags: review?(rnewman) → review+
Hardware: ARM → All
Whiteboard: [upstream needed]
https://hg.mozilla.org/mozilla-central/rev/adc99de50f0d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
Upstreamed at last (slightly later than is probably ideal. Sorry. This one resisted automation: looks like something over on android-sync bitrotted me.):
https://github.com/mozilla-services/android-sync/pull/489
Upstreamed.
Whiteboard: [upstream needed]
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.