Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6cb1077d85c825a9a89187ae89483449033a144c
      
https://github.com/WebKit/WebKit/commit/6cb1077d85c825a9a89187ae89483449033a144c
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-28 (Tue, 28 Jul 2026)

  Changed paths:
    M Source/WTF/wtf/text/StringView.cpp

  Log Message:
  -----------
  makeStringByReplacingAll() uses a scalar scan instead of SIMD-accelerated 
find()
https://bugs.webkit.org/show_bug.cgi?id=320155
rdar://183089603

Reviewed by Chris Dumez.

makeStringByReplacingAll() hand-rolled a first-occurrence loop in both the
8-bit and 16-bit branches to locate the target character. WTF::find() is
SIMD-accelerated (find8()/find16()) and is used everywhere else for exactly
this, so replacing both loops is a real win on long strings.
Collapse the two branches into a single generic lambda templated on the span's
character type. This also drops the explicit !isLatin1(target) early return:
the find(span<Latin1Character>, char16_t) overload already returns notFound for
a non-Latin1 target, so an 8-bit string searched for a 16-bit target still
returns the original string unchanged. No behavior change.

* Source/WTF/wtf/text/StringView.cpp:
(WTF::makeStringByReplacingAll):

Canonical link: https://commits.webkit.org/318051@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to