Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: df4b04b23a9b3c363f6515671af6c92a4037ada6
https://github.com/WebKit/WebKit/commit/df4b04b23a9b3c363f6515671af6c92a4037ada6
Author: Chris Dumez <[email protected]>
Date: 2026-06-19 (Fri, 19 Jun 2026)
Changed paths:
M Source/WebCore/Modules/url-pattern/URLPattern.cpp
M Source/WebCore/Modules/url-pattern/URLPatternConstructorStringParser.cpp
Log Message:
-----------
Avoid unnecessary URLPatternInit copies on construction
https://bugs.webkit.org/show_bug.cgi?id=316071
Reviewed by Anne van Kesteren.
URLPatternInit holds eight String members; copying it bumps the refcount
on each. Two paths in the URLPattern constructor were copying instead of
moving from rvalue sources:
- URLPattern::create() takes URLPatternInput as an rvalue reference, but
std::get<URLPatternInit>(input) returned an lvalue, so the assignment
copied. Now wrapped in WTF::move().
- URLPatternConstructorStringParser::parse() returned a copy of m_result.
The parser is constructed as a temporary at its only call site, so
moving from the member is safe.
* Source/WebCore/Modules/url-pattern/URLPattern.cpp:
(WebCore::URLPattern::create):
* Source/WebCore/Modules/url-pattern/URLPatternConstructorStringParser.cpp:
(WebCore::URLPatternConstructorStringParser::parse):
Canonical link: https://commits.webkit.org/315558@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications