Closed
Bug 387023
Opened 18 years ago
Closed 18 years ago
Minor string cleanup in nsAtomTable.cpp
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sharparrow1, Assigned: sharparrow1)
Details
Attachments
(1 file, 2 obsolete files)
5.20 KB,
patch
|
benjamin
:
review+
bzbarsky
:
approval1.9+
|
Details | Diff | Splinter Review |
Avoid a bit of potential unnecessary string copying and make nsStaticAtomWrapper hold onto its string directly.
Attachment #271117 -
Flags: review?(benjamin)
Assignee | ||
Comment 1•18 years ago
|
||
Comment on attachment 271117 [details] [diff] [review]
Patch
There's more simplification that really needs to be done; the PromiseFloatString call in NS_NewAtom actually seems to take up a non-trivial amount of time.
Attachment #271117 -
Flags: review?(benjamin)
Assignee | ||
Comment 2•18 years ago
|
||
Some small stuff, could lead to a minor perf improvement by avoiding calling PromiseFlatString and avoiding string copies in some cases.
Assignee: nobody → sharparrow1
Attachment #271117 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #278119 -
Flags: review?(benjamin)
Assignee | ||
Comment 3•18 years ago
|
||
Comment on attachment 278119 [details] [diff] [review]
Patch v2
Oops, wrong version.
Attachment #278119 -
Attachment is obsolete: true
Attachment #278119 -
Flags: review?(benjamin)
Assignee | ||
Comment 4•18 years ago
|
||
All right, here's the right version.
Attachment #278120 -
Flags: review?(benjamin)
Comment 5•18 years ago
|
||
Comment on attachment 278120 [details] [diff] [review]
Patch v3
>Index: nsAtomTable.cpp
>- CompareUTF8toUTF16(nsDependentCString(atomString, he->getLength()),
>- nsDependentString(strKey->getUTF16String(),
>- strKey->getLength())) == 0;
>+ CompareUTF8toUTF16(nsDependentCSubstring(atomString, atomString + he->getLength()),
>+ nsDependentSubstring(strKey->getUTF16String(),
>+ strKey->getUTF16String() + strKey->getLength())) == 0;
I understand all the changes except for this one. Why did you need to change to the substring type here?
Assignee | ||
Comment 6•18 years ago
|
||
I don't think it's legal to use nsDependentString on a buffer that isn't guaranteed to be null-terminated. I don't think it actually matters here, though, because CompareUTF8toUTF16 doesn't happen to care.
Updated•18 years ago
|
Attachment #278120 -
Flags: review?(benjamin) → review+
Assignee | ||
Updated•18 years ago
|
Attachment #278120 -
Flags: approval1.9?
![]() |
||
Comment 7•18 years ago
|
||
Comment on attachment 278120 [details] [diff] [review]
Patch v3
a=bzbarsky assuming he .NET thing still compiles
Attachment #278120 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 8•18 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•