[Webkit-unassigned] [Bug 202090] New: clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebCore

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 22 04:47:43 PDT 2019


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

            Bug ID: 202090
           Summary: clang-tidy: Fix unnecessary copy/ref churn of for loop
                    variables in WebCore
           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: ddkilzer at webkit.org
                CC: cdumez at apple.com, cfleizach at apple.com,
                    eric.carlson at apple.com, jer.noble at apple.com,
                    youennf at gmail.com

Running clang-tidy on WebCore resulted in these potential performance improvements to prevent object copies or reference churn in for loop variables:

Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp:174:27: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
                for (auto request : fpsPssh.initDataBox().requests()) {
                          ^
                     const  &
--
Source/WebCore/svg/SVGStringList.h:78:19: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
        for (auto string : m_items) {
                  ^
             const  &
--
Source/WebCore/./platform/ios/PlatformPasteboardIOS.mm:729:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto type : types)
              ^
         const  &
--
Source/WebCore/./accessibility/AccessibilityObject.cpp:493:19: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
        for (auto misspelling : misspellings) {
                  ^
             const  &
--
Source/WebCore/./accessibility/AccessibilityObject.cpp:985:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto textRange : operation.textRanges) {
              ^
         const  &
--
Source/WebCore/./html/HTMLSlotElement.cpp:119:23: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (RefPtr<Node> node : *assignedNodes) {
                      ^
         const       &
--
Source/WebCore/./layout/inlineformatting/InlineFormattingContextLineLayout.cpp:368:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto floatItem : floats) {
              ^
         const  &
--
Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:664:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto loadResult : _loadResults) {
              ^
         const  &
--
Source/WebCore/html/track/WebVTTParser.cpp:392:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto rule : childRules) {
              ^
         const  &
--
Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp:81:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto transceiver : m_transceivers)
              ^
         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/20190922/b33b0065/attachment-0001.html>


More information about the webkit-unassigned mailing list