[Webkit-unassigned] [Bug 50245] Add word-prefix search options to the text search without ICU

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 17 11:01:27 PDT 2011


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #95002|review?                     |review-
               Flag|                            |




--- Comment #4 from Darin Adler <darin at apple.com>  2011-06-17 11:01:27 PST ---
(From update of attachment 95002)
View in context: https://bugs.webkit.org/attachment.cgi?id=95002&action=review

Need to at least fix the memcpy problem. But I think that also using a circular buffer instead of a memmove each time is the way to go. It may be tricky to get a circular buffer to work with functions such as U16_GET, though, so not sure it will be easy.

>> Source/WebCore/editing/TextIterator.cpp:2189
>> +
> 
> same thing here. We can move identical code to the common place.

We don’t want to copy and paste this code, yes, so we need a version of the patch that does not involve a second copy.

>> Source/WebCore/editing/TextIterator.cpp:2236
>> +            memcpy(m_context.data(), m_context.data() + 1, (m_context.size() - 1) * sizeof(UChar));
> 
> memcpy to overlapped place may cause unexpected results?

That’s right. You can’t use memcpy for this; it has to be memmove instead.

And doing a memmove every time we add a character is really inefficient. I suggest considering a circular buffer instead.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list