[webkit-reviews] review granted: [Bug 175757] StringView could use a function to strip leading/trailing characters without allocation : [Attachment 318607] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Aug 20 18:31:35 PDT 2017
youenn fablet <youennf at gmail.com> has granted Sam Weinig <sam at webkit.org>'s
request for review:
Bug 175757: StringView could use a function to strip leading/trailing
characters without allocation
https://bugs.webkit.org/show_bug.cgi?id=175757
Attachment 318607: Patch
https://bugs.webkit.org/attachment.cgi?id=318607&action=review
--- Comment #5 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 318607
--> https://bugs.webkit.org/attachment.cgi?id=318607
Patch
I like this.
View in context: https://bugs.webkit.org/attachment.cgi?id=318607&action=review
> Source/WTF/wtf/text/StringView.h:123
> + StringView
stripLeadingAndTrailingMatchedCharacters(MachedCharacterPredicate&&);
s/Mached/Matched/
> Source/WTF/wtf/text/StringView.h:163
> + template<typename CharacterType, class MachedCharacterPredicate>
Why using both typename and class?
> Tools/TestWebKitAPI/Tests/WTF/StringView.cpp:938
> +
EXPECT_TRUE(stringViewFromLiteral("AAAAAAAAA").stripLeadingAndTrailingMatchedCh
aracters(isA) == StringView::empty());
For completeness, you could add AAAAAAAAB, BAAAAAAAA and maybe AAABABAAA.
More information about the webkit-reviews
mailing list