[Webkit-unassigned] [Bug 201144] New: Don't compute upconverted characters twice in buildQuery() in DataDetection.mm

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 26 12:26:21 PDT 2019


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

            Bug ID: 201144
           Summary: Don't compute upconverted characters twice in
                    buildQuery() in DataDetection.mm
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Keywords: InRadar
          Severity: Normal
          Priority: P2
         Component: HTML Editing
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: bfulgham at webkit.org, megan_gardner at apple.com,
                    wenson_hsieh at apple.com

Currently upconverted characters (and string length) are computed twice in buildQuery() in DataDetection.mm:

    for (TextIterator iterator(contextRange); !iterator.atEnd(); iterator.advance(), iteratorCount++) {
        size_t currentTextLength = iterator.text().length();
        [...]
        const UniChar* currentCharPtr = iterator.text().upconvertedCharacters();
        [...]
        RetainPtr<CFStringRef> currentText = adoptCF(CFStringCreateWithCharacters(kCFAllocatorDefault, iterator.text().upconvertedCharacters(), iterator.text().length()));
        [...]
    }

<https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/editing/cocoa/DataDetection.mm#L365>

There's no need to compute these twice, so we can extract the common code.

<rdar://problem/54689399>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190826/56798d21/attachment-0001.html>


More information about the webkit-unassigned mailing list