Closed
Bug 888086
Opened 12 years ago
Closed 12 years ago
sync/Utils.java claims `StringBuffer should be used instead`
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 27
People
(Reporter: ckitching, Assigned: mcomella)
Details
Attachments
(1 file, 2 obsolete files)
|
3.35 KB,
patch
|
mcomella
:
review+
|
Details | Diff | Splinter Review |
Method byte2hex of Utils.java in mobile/android/base/sync has a comment reminding the programmer that StringBuffer should be used instead of String concatenation in this method, but concatenation is wastefully still being used (And what you really want here is a StringBuilder anyway, because it`s only being accessed from one thread)
Let´s fix that.
| Reporter | ||
Updated•12 years ago
|
Assignee: nobody → ckitching
| Reporter | ||
Comment 1•12 years ago
|
||
A patch to do as described.
Attachment #768655 -
Flags: review?(margaret.leibovic)
| Reporter | ||
Comment 2•12 years ago
|
||
Missed the initial capacity... fixed.
Attachment #768655 -
Attachment is obsolete: true
Attachment #768655 -
Flags: review?(margaret.leibovic)
Attachment #768659 -
Flags: review?(margaret.leibovic)
Comment 3•12 years ago
|
||
Comment on attachment 768659 [details] [diff] [review]
byte2hex now uses StringBuilder, as requested by the comment, V2 (Added initial capacity).
This is also rnewman's domain.
You've made your way into sync code! :)
Attachment #768659 -
Flags: review?(margaret.leibovic) → review?(rnewman)
Comment 4•12 years ago
|
||
Comment on attachment 768659 [details] [diff] [review]
byte2hex now uses StringBuilder, as requested by the comment, V2 (Added initial capacity).
Review of attachment 768659 [details] [diff] [review]:
-----------------------------------------------------------------
Don't forget to clean up the patch headers; 'hg qfold' concatenates your temporary commit messages into the destination patch.
In order to land this, you first need to take it upstream:
https://github.com/mozilla-services/android-sync/blob/develop/README.rst
This is a good set of skills to acquire. If you can test that change (there are plenty of tests in the repo that exercise it), open a pull req and we'll get it merged in both places.
If you're disinclined to do so (I know margaret is a harsh taskmistress), let me know and I'll take care of the landing.
Please don't set checkin-needed without addressing the style nit and upstreaming first.
::: mobile/android/base/sync/Utils.java
@@ +82,5 @@
> /**
> * Helper to convert a byte array to a hex-encoded string
> */
> public static String byte2hex(byte[] b) {
> + StringBuilder hs = new StringBuilder(b.length*2);
Spaces around arithmetic operators.
Attachment #768659 -
Flags: review?(rnewman) → review+
Updated•12 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 5•12 years ago
|
||
I implemented the test ckitching was missing:
https://github.com/mozilla-services/android-sync/pull/362
Flags: needinfo?(rnewman)
| Assignee | ||
Comment 6•12 years ago
|
||
r+ via github.
Assignee: chriskitching → michael.l.comella
Flags: needinfo?(rnewman)
| Assignee | ||
Comment 7•12 years ago
|
||
r+ via github.
Attachment #768659 -
Attachment is obsolete: true
Attachment #814673 -
Flags: review+
| Assignee | ||
Comment 8•12 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Comment 9•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 27
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•