Summary: | Remove UChar* accessors from StringImpl | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> | ||||
Component: | New Bugs | Assignee: | Eric Seidel (no email) <eric> | ||||
Status: | RESOLVED INVALID | ||||||
Severity: | Normal | CC: | andersca, darin, sam | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Eric Seidel (no email)
2008-07-16 15:31:29 PDT
Created attachment 22340 [details]
First attempt, push logic from String.cpp into StringImpl.cpp
WebCore/ChangeLog | 26 ++++++++
WebCore/platform/text/PlatformString.h | 2 +
WebCore/platform/text/String.cpp | 79 ++++++-------------------
WebCore/platform/text/StringImpl.cpp | 104 +++++++++++++++++++++++++++++---
WebCore/platform/text/StringImpl.h | 12 ++++-
5 files changed, 153 insertions(+), 70 deletions(-)
Comment on attachment 22340 [details]
First attempt, push logic from String.cpp into StringImpl.cpp
These changes are OK, but I don't think they really free us up to change the implementation. There are clients of String::characters() and for good reason.
102 // String::append and insert are extremely in-efficient, if you're doing many
103 // appends and inserts, consider using a Vector<UChar> or SegmetedString
inefficient doesn't have a "-" in it.
SegmentedString has an "n" in it.
162 m_impl = m_impl->insert(charactersToInsert, lengthToInsert, position);
Why did you remove the ASSERT(m_impl) from this function?
I noticed that StringImpl::append(StringImpl*) does not optimize the zero-length case. The old code didn't either, but that's not good.
I also think it's a bit strange to use codePointAt everywhere instead of the [] operator.
r=me
Closed the wrong bug by accident. (In reply to comment #2) > (From update of attachment 22340 [details] [review]) > These changes are OK, but I don't think they really free us up to change the > implementation. There are clients of String::characters() and for good reason. Yeah, I kinda lost interest in this change after making it. But I'm finally cleaning it up today to land. I think there were some nice clean-ups in it, making it worth landing. > 102 // String::append and insert are extremely in-efficient, if you're > doing many > 103 // appends and inserts, consider using a Vector<UChar> or > SegmetedString > > inefficient doesn't have a "-" in it. > SegmentedString has an "n" in it. Fixed. > 162 m_impl = m_impl->insert(charactersToInsert, lengthToInsert, position); > > Why did you remove the ASSERT(m_impl) from this function? Shouldn't have. Fixed. > I noticed that StringImpl::append(StringImpl*) does not optimize the > zero-length case. The old code didn't either, but that's not good. Fixed. > I also think it's a bit strange to use codePointAt everywhere instead of the [] > operator. Felt clearer in my head at the time at least. I've decided this is not worth pursuing at this time. Closing. |