Closed
Bug 628716
Opened 15 years ago
Closed 15 years ago
Remove m_numReferences from nsMsgHdr
Categories
(MailNews Core :: Database, defect)
MailNews Core
Database
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3.3a3
People
(Reporter: standard8, Assigned: neil)
Details
(Keywords: memory-footprint)
Attachments
(1 file)
|
2.50 KB,
patch
|
Bienvenu
:
review+
|
Details | Diff | Splinter Review |
Per bug 628094 we believe that m_numReferences is no longer required as a separate variable, m_references.Length() should just be able to be used instead.
Assigning to Neil as he said he'd do a patch for this if we're interested, which we are ;-)
Updated•15 years ago
|
| Assignee | ||
Comment 1•15 years ago
|
||
Comparing a PRInt32 and a PRUint16 does a signed comparison (a PRInt32 can contain the range of a PRUint16 so there's no ambiguity). Now the old nsCStringArray bounds-checked its index, which meant that calling GetStringReference(-1) returned an empty string (by comparison calling GetStringReference(32767) throws). The TArray version doesn't, which means that the code currently in the tree will crash if you try to get the -1th reference. Simply changing the comparison to .Length(), which is now a PRUint32, generates a signed/unsigned comparison warning, for good reason! The cast is designed so that passing in -1 results in 4294967295 and thus fails the comparison.
Alternatively I could change the API to use PRUint32 throughout but we have PRInt32 descending loop indices which are a pain to convert to PRUint32.
Attachment #507086 -
Flags: review?(bienvenu)
Comment 2•15 years ago
|
||
Comment on attachment 507086 [details] [diff] [review]
Proposed patch
looks good, thx.
Attachment #507086 -
Flags: review?(bienvenu) → review+
| Assignee | ||
Comment 3•15 years ago
|
||
Pushed changeset c33788adf0ab to comm-central.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Flags: in-testsuite-
Target Milestone: --- → Thunderbird 3.3a3
You need to log in
before you can comment on or make changes to this bug.
Description
•