[Webkit-unassigned] [Bug 273563] New: Avoid returning FontSizeAdjust as a copy

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 1 12:31:30 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=273563

            Bug ID: 273563
           Summary: Avoid returning FontSizeAdjust as a copy
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: bfulgham at webkit.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240501/e49e37e2/attachment.htm>


More information about the webkit-unassigned mailing list