Closed Bug 451058 Opened 14 years ago Closed 14 years ago

Address post-review comments

Categories

(Toolkit :: Storage, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b1

People

(Reporter: sdwilsh, Assigned: sdwilsh)

References

Details

Attachments

(1 file)

Attached patch v1.0Splinter Review
Attachment #335834 - Flags: review?(neil)
Whiteboard: [has patch][needs review Neil]
Comment on attachment 335834 [details] [diff] [review]
v1.0

>     *_result = NS_Alloc(sizeof(PRUint8) * aData.Length());
>     NS_ENSURE_TRUE(*_result, NS_ERROR_OUT_OF_MEMORY);
> 
>-    PRUint8 *result = static_cast<PRUint8 *>(*_result);
>-    for (PRUint32 i = 0; i < aData.Length(); i++)
>-      result[i] = aData[i];
>+    *_result = nsMemory::Clone(aData.Elements(), aData.Length() * sizeof(PRUint8));
Clone allocates, so you don't need the NS_Alloc, but you do want to keep the NS_ENSURE_TRUE. r=me with that fixed.
Attachment #335834 - Flags: review?(neil) → review+
Pushed to mozilla-central with last comment fixed:
http://hg.mozilla.org/mozilla-central/rev/68c9ad2c735e
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite-
Flags: in-litmus-
Resolution: --- → FIXED
Whiteboard: [has patch][needs review Neil]
Target Milestone: --- → mozilla1.9.1b1
You need to log in before you can comment on or make changes to this bug.