[Webkit-unassigned] [Bug 192814] New: clang-tidy: Use const reference for MediaTime parameter to prevent object copy

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 18 11:03:00 PST 2018


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

            Bug ID: 192814
           Summary: clang-tidy: Use const reference for MediaTime
                    parameter to prevent object copy
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Media Elements
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: dbates at webkit.org, eric.carlson at apple.com

Running `clang-tidy -header-filter=.* -checks='-*,performance-*,-performance-noexcept-*' ...` on JavaScriptCore and WebCore source files found these unnecessary object copies in MediaTime function parameters in trunk revision r239112.

Source/JavaScriptCore/runtime/JSCJSValue.h:554:42: warning: the parameter 't' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
ALWAYS_INLINE JSValue jsNumber(MediaTime t)
                                         ^
                               const    &

Source/WebCore/bindings/js/JSDOMConvertNumbers.h:392:43: warning: the parameter 'value' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
    static JSC::JSValue convert(MediaTime value)
                                          ^
                                const    &

-- 
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/20181218/7e1a585f/attachment.html>


More information about the webkit-unassigned mailing list