Bug 273563
| Summary: | Avoid returning FontSizeAdjust as a copy | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> |
| Component: | WebCore Misc. | Assignee: | Brent Fulgham <bfulgham> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | ntim, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Brent Fulgham
The changes in https://commits.webkit.org/262309@main changed the return value of FontDescription::fontSizeAdjust() from std::optional<float> to a new struct FontSizeAdjust, but continued to return it by copy. There is now a lot of code doing things like from.fontSizeAdjust().value that now generating temporary copies of objects that wrap the original std::optional plus include two additional enum types.
This patch returns a const reference so that a copy can be avoided in cases where we just want to retrieve the `value` member of the FontSizeAdjust.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127378219>
Brent Fulgham
Pull request: https://github.com/WebKit/WebKit/pull/27996