[webkit-reviews] review granted: [Bug 239370] Replace complex String::insert() with a simplified makeStringByInserting() free function : [Attachment 457728] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 15 20:13:55 PDT 2022


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 239370: Replace complex String::insert() with a simplified
makeStringByInserting() free function
https://bugs.webkit.org/show_bug.cgi?id=239370

Attachment 457728: Patch

https://bugs.webkit.org/attachment.cgi?id=457728&action=review




--- Comment #16 from Darin Adler <darin at apple.com> ---
Comment on attachment 457728
  --> https://bugs.webkit.org/attachment.cgi?id=457728
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=457728&action=review

> Source/WTF/wtf/text/WTFString.cpp:84
> +    StringView originalStringView { originalString };
> +    return makeString(originalStringView.left(position), stringToInsert,
originalStringView.substring(position));

Wait, there’s nothing about this function taking advantage of the fact that
originalString is a String, so we should change it to take a StringView!

> Source/WebCore/dom/CharacterData.cpp:141
> +    String newData = makeStringByInserting(m_data, data, offset);

auto, like below


More information about the webkit-reviews mailing list