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>
Created attachment 377260 [details] Patch v1
Comment on attachment 377260 [details] Patch v1 r=me
Comment on attachment 377260 [details] Patch v1 Clearing flags on attachment: 377260 Committed r249115: <https://trac.webkit.org/changeset/249115>
All reviewed patches have been landed. Closing bug.