Closed
Bug 387044
Opened 17 years ago
Closed 17 years ago
Cleanup string usage in nsCSSParser
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sharparrow1, Unassigned)
Details
Attachments
(1 file)
11.59 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Some small stuff.
Attachment #271136 -
Flags: review?(bzbarsky)
Comment 1•17 years ago
|
||
So how do .get() and BeginReading() actually differ? I assume the big win here is the lack of need to call PromiseFlatString() and the lack of a copy in ParseColorString()?
Reporter | ||
Comment 2•17 years ago
|
||
(In reply to comment #1) > So how do .get() and BeginReading() actually differ? The primary difference is that you can only call get() on a string with guaranteed null-terminated storage, i.e. an ns[C]String. They return exactly the same pointer. The minor difference is that BeginReading returns a const char*. > I assume the big win here > is the lack of need to call PromiseFlatString() and the lack of a copy in > ParseColorString()? That's right. PromiseFlatString is probably cheap in this case (just a small stack allocation plus a function call) because we're unlikely to be passing in non-null-terminated strings; however, we don't need it.
Reporter | ||
Comment 3•17 years ago
|
||
Wait, actually BeginReading involves a function call. But it's functionally the same for internal strings.
Reporter | ||
Comment 4•17 years ago
|
||
(In reply to comment #3) > Wait, actually BeginReading involves a function call. But it's functionally > the same for internal strings. Wait, no, I was right the first time... I got confused by some code that's ifdef'ed out.
Comment 5•17 years ago
|
||
Comment on attachment 271136 [details] [diff] [review] Patch Oh, BeginReading() is inlined too. Great. r+sr=bzbarsky
Attachment #271136 -
Flags: superreview+
Attachment #271136 -
Flags: review?(bzbarsky)
Attachment #271136 -
Flags: review+
Reporter | ||
Comment 6•17 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•