Closed
Bug 1233935
Opened 9 years ago
Closed 8 years ago
use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in mailnews/
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(firefox46 affected)
RESOLVED
FIXED
Thunderbird 47.0
Tracking | Status | |
---|---|---|
firefox46 | --- | affected |
People
(Reporter: philip.chee, Assigned: jorgk-bmo)
References
Details
Attachments
(1 file, 1 obsolete file)
14.13 KB,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
UniquePtr<T[]> is better and encourages people to write clearer code. nsAutoArrayPtr should be converted to use UniquePtr<T[]> instead; the idiomatic way of declaring and defining a UniquePtr is: auto var = MakeUnique<T[]>(length); Since nsAutoArrayPtr implicitly converts to T* and UniquePtr does not, you'll have to add |.get()| calls for all uses of the raw pointer. Accesses such as |var[i]| do not need any special treatment.
Assignee | ||
Comment 1•8 years ago
|
||
This is a small problem, 5 occurrences: https://dxr.mozilla.org/comm-central/search?q=nsAutoArrayPtr&redirect=false&case=false mailnews/base/search/src/nsMsgSearchAdapter.cpp 555 nsAutoArrayPtr<char> newValue(new char[2*strlen(vptr) + 1]); mailnews/base/src/nsMsgSearchDBView.cpp 782 nsAutoArrayPtr<nsTArray<uint32_t> > indexArrays; mailnews/base/util/nsMsgCompressIStream.h 28 nsAutoArrayPtr<char> m_zbuf; 29 nsAutoArrayPtr<char> m_databuf; mailnews/base/util/nsMsgCompressOStream.h 25 nsAutoArrayPtr<char> m_zbuf;
Assignee | ||
Comment 2•8 years ago
|
||
Fixed 3 of 5, patch coming ;-)
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Reporter | ||
Comment 3•8 years ago
|
||
Bug 1229985 (remove nsAutoArrayPtr) has landed on mozilla-inbound
Assignee | ||
Comment 4•8 years ago
|
||
I know, that's why I'm working on it. Now I've fixed 4 out of 5. Stand by for the patch ;-)
Assignee | ||
Comment 5•8 years ago
|
||
Sorry about the r?-SPAM. This is a pre-active bustage fix, please review asap. One review only ;-)
Attachment #8723737 -
Flags: review?(rkent)
Attachment #8723737 -
Flags: review?(mkmelin+mozilla)
Attachment #8723737 -
Flags: review?(Pidgeot18)
Comment 6•8 years ago
|
||
Comment on attachment 8723737 [details] [diff] [review] 1233935.patch (v1) Review of attachment 8723737 [details] [diff] [review]: ----------------------------------------------------------------- rs=me ::: mailnews/base/src/nsMsgSearchDBView.cpp @@ +882,5 @@ > > nsresult > +nsMsgSearchDBView::PartitionSelectionByFolder(nsMsgViewIndex *indices, > + int32_t numIndices, > + mozilla::UniquePtr<nsTArray<uint32_t>[]>& indexArrays, Nit: &indexArrays, not & indexArrays. Although this is a nasty typename in general, not that I see a way around it.
Attachment #8723737 -
Flags: review?(rkent)
Attachment #8723737 -
Flags: review?(mkmelin+mozilla)
Attachment #8723737 -
Flags: review?(Pidgeot18)
Attachment #8723737 -
Flags: review+
Assignee | ||
Comment 7•8 years ago
|
||
Boy, that was quick, does that mean we can land it and won't actually have bustage ;-)
Attachment #8723737 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8723781 -
Flags: review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 8•8 years ago
|
||
https://hg.mozilla.org/comm-central/rev/d4f1823361ae
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 47.0
You need to log in
before you can comment on or make changes to this bug.
Description
•