[webkit-reviews] review granted: [Bug 125619] Improve the find word boundary performance : [Attachment 219133] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 12 17:34:19 PST 2013


Darin Adler <darin at apple.com> has granted KyungTae Kim <ktf.kim at samsung.com>'s
request for review:
Bug 125619: Improve the find word boundary performance
https://bugs.webkit.org/show_bug.cgi?id=125619

Attachment 219133: Patch
https://bugs.webkit.org/attachment.cgi?id=219133&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=219133&action=review


> Source/WebCore/ChangeLog:11
> +	   No tests because no operation changes.

Normally we are able to build performance tests that show benefits in cases
like this.

> Source/WebCore/platform/text/mac/TextBoundaries.mm:52
> +void findEndWordBoundary(const UChar* chars, int len, int position, int*
end)
> +{
> +    NSString* string = [[NSString alloc]
initWithCharactersNoCopy:const_cast<unichar*>(chars)
> +	   length:len freeWhenDone:NO];
> +    NSAttributedString* attr = [[NSAttributedString alloc]
initWithString:string];
> +    NSRange range = [attr doubleClickAtIndex:(position >= len) ? len - 1 :
position];
> +    [attr release];
> +    [string release];
> +    *end = range.location + range.length;
> +}

Looks fine. Or we could just have this call findWordBoundary.


More information about the webkit-reviews mailing list