Improve nsAbDirectoryDataSource and nsSubscribeDataSource ArcLabelsOut functions

RESOLVED FIXED

Status

MailNews Core
Backend
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

3.68 KB, patch
neil@parkwaycc.co.uk
: review+
neil@parkwaycc.co.uk
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

10 years ago
Created attachment 306913 [details] [diff] [review]
The fix

Following on from dwitte's comment in bug 406198, and also the realisation now that we can pre-set an nsCOMArray's size (maybe not on the stack, but at least set it in one go), I think it would be better to change the ArcLabelsOut functions of nsAbDirectoryDataSource and nsSubscribeDataSource to use nsCOMArray rather than nsIMutableArray.

Patch attached.
Attachment #306913 - Flags: superreview?(neil)
Attachment #306913 - Flags: review?(neil)

Comment 1

10 years ago
Comment on attachment 306913 [details] [diff] [review]
The fix

I don't know how long we intend to keep these datasources ;-)

>+    nsCOMArray<nsIRDFResource> array(hasChildren ? 5 : 6);
This is the wrong way around ;-) but I'd just allocate 6 all the time anyway.
Attachment #306913 - Flags: superreview?(neil)
Attachment #306913 - Flags: superreview+
Attachment #306913 - Flags: review?(neil)
Attachment #306913 - Flags: review+
(Assignee)

Comment 2

10 years ago
Checked in -> fixed.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.