[Webkit-unassigned] [Bug 67081] StringBuilder::toStringReserveCapacity() needs to be const

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 9 18:57:46 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=67081





--- Comment #2 from Darin Adler <darin at apple.com>  2011-09-09 18:57:46 PST ---
(From update of attachment 106709)
View in context: https://bugs.webkit.org/attachment.cgi?id=106709&action=review

This patch still has too many changes in it at once. Each change needs to be looked at carefully. Can we do this in smaller pieces. The issues are different for different items here, so reviewing all at once is too hard. I made a few comments.

> Source/JavaScriptCore/wtf/text/StringBuilder.h:46
>          // If we're appending to an empty string, and there is not buffer

Small grammar mistake: is not a buffer

> Source/JavaScriptCore/wtf/text/StringBuilder.h:59
> +        // If we're appending to an empty string, and there is not buffer

Small grammar mistake: is not a buffer

> Source/WebCore/html/parser/HTMLPreloadScanner.cpp:69
> +            AtomicString attributeName(iter->m_name.toStringPreserveCapacity());

We don’t want to allocate a string here if there is already an AtomicString with the correct value. The old code did that correctly, but the new code instead always a string.

> Source/WebCore/html/parser/HTMLTokenizer.cpp:1590
> -    return vectorEqualsString(m_temporaryBuffer, expectedString);
> +    return m_temporaryBuffer.toStringPreserveCapacity() == expectedString;

It seems like a bad design that we have to convert a string buffer to a string just to compare it with a string. I suggest instead we overload the == operator so it can work directly on a StringBuffer.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list