Bug 239685

Summary: Replace String::replace() functions with makeStringByReplacingAll() free functions
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web Template FrameworkAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, ggaren, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=239500

Description Chris Dumez 2022-04-22 21:24:12 PDT
Replace String::replace() functions with makeStringByReplacingAll() free functions.

"All" is added to the name since every instance is replaced, not just the first one. Making it a free function that returns a new String is a step towards making String immutable.

In the future, we may want to add a makeStringByReplacingAll() that takes in a StringView instead of a `const String`. Some call sites would benefit from that.
Comment 1 Chris Dumez 2022-04-22 22:08:05 PDT
Pull request: https://github.com/WebKit/WebKit/pull/368
Comment 2 EWS 2022-04-25 08:26:03 PDT
Committed r293326 (249949@main): <https://commits.webkit.org/249949@main>

Reviewed commits have been landed. Closing PR #368 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-04-25 08:27:14 PDT
<rdar://problem/92270440>