Closed
Bug 617897
Opened 14 years ago
Closed 12 years ago
Replace calls to AppendASCII('*') with Append('*')
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: alfredkayser, Assigned: orva)
References
(Blocks 1 open bug)
Details
(Keywords: memory-footprint, perf, Whiteboard: [mentor=Yoric][lang=c++])
Attachments
(1 file)
9.56 KB,
patch
|
dougt
:
review+
Yoric
:
feedback+
|
Details | Diff | Splinter Review |
In mozilla/ xpcom/ io/ nsLocalFileWin.cpp there are calls to AppendASCII which should be replaced by AppendLiteral, and for the case of one character with just Append('*') or Append('\\');
This prevent the need for a string, strlen, strcpy, etc.
Reporter | ||
Updated•14 years ago
|
Assignee: nobody → alfredkayser
Reporter | ||
Comment 1•12 years ago
|
||
http://mxr.mozilla.org/mozilla-central/search?string=AppendASCII%28%22&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central
The difference between AppendASCII("...") and AppendLiteral("...") is that the first also a does a "strlen" on the argument, whilst the second uses the compiler to pass the string length.
Reporter | ||
Updated•12 years ago
|
Assignee | ||
Comment 3•12 years ago
|
||
Simple patch, test cases left untouched. As this is my "low hanging fruit" to get familiar with Mozilla development process, all criticism is more than welcome.
Attachment #745201 -
Flags: review?(dteller)
Reporter | ||
Comment 4•12 years ago
|
||
This looks good to me!
Nit:
In nsLocalFileWin.cpp, I would replace:
738 if (filename.Last() == L'/' || filename.Last() == L'\\')
739 filename.AppendASCII("*");
740 else
741 filename.AppendASCII("\\*");
742
743 filename.ReplaceChar(L'/', L'\\');
with:
filename.ReplaceChar(L'/', L'\\');
if (filename.Last() != L'\\') filename.Append('\\');
filename.Append('*');
But that is probably best for another bug.
Assignee: alfredkayser → iivari.aikas
Status: NEW → ASSIGNED
Comment 5•12 years ago
|
||
Comment on attachment 745201 [details] [diff] [review]
patch
Review of attachment 745201 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, too.
Passing to someone who has review rights on that directory.
Attachment #745201 -
Flags: review?(dteller)
Attachment #745201 -
Flags: review?(doug.turner)
Attachment #745201 -
Flags: feedback+
Updated•12 years ago
|
Attachment #745201 -
Flags: review?(doug.turner) → review+
Updated•12 years ago
|
Keywords: checkin-needed
Comment 6•12 years ago
|
||
Keywords: checkin-needed
Comment 7•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in
before you can comment on or make changes to this bug.
Description
•