Bug 239685 - Replace String::replace() functions with makeStringByReplacingAll() free functions
Summary: Replace String::replace() functions with makeStringByReplacingAll() free func...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-22 21:24 PDT by Chris Dumez
Modified: 2022-04-25 08:27 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>