<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/"
   href="https://bugs.webkit.org/show_bug.cgi?id=192708">192708</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Local Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Media Elements
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ddkilzer@webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>eric.carlson@apple.com, jer.noble@apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Running `clang-tidy -checks='-*,performance-*,-performance-noexcept-*' ...` on WebCore source files found these unnecessary object copies:

Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:303:83: warning: the parameter 'pair' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
static ImageDecoderAVFObjCSample* toSample(PresentationOrderSampleMap::value_type pair)
                                                                                  ^
                                           const                                 &

Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:1533:65: warning: the parameter 'asset' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void MediaPlayerPrivateAVFoundationObjC::setAsset(RetainPtr<id> asset)
                                                                ^
                                                  const        &
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3056:30: warning: parameter 'seekableRanges' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
    m_cachedSeekableRanges = seekableRanges;
                             ^
                             std::move(    )
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3064:28: warning: parameter 'loadedRanges' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
    m_cachedLoadedRanges = loadedRanges;
                           ^
                           std::move(  )
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3126:79: warning: the parameter 'metadata' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(RetainPtr<NSArray> metadata, const MediaTime& mediaTime)
                                                                              ^
                                                           const             &
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:3168:77: warning: the parameter 'tracks' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void MediaPlayerPrivateAVFoundationObjC::tracksDidChange(RetainPtr<NSArray> tracks)
                                                                            ^
                                                         const             &

Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:304:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto key : m_sampleBufferAudioRendererMap.keys())
              ^
         const  &
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:315:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto key : m_sampleBufferAudioRendererMap.keys())
              ^
         const  &
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:463:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto key : m_sampleBufferAudioRendererMap.keys())
              ^
         const  &

Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:1162:74: warning: the parameter 'time' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
MediaTime SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime(MediaTime time, MediaTime negativeThreshold, MediaTime positiveThreshold)
                                                                         ^
                                                               const    &
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:1162:90: warning: the parameter 'negativeThreshold' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
MediaTime SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime(MediaTime time, MediaTime negativeThreshold, MediaTime positiveThreshold)
                                                                                         ^
                                                                               const    &
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:1162:119: warning: the parameter 'positiveThreshold' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
MediaTime SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime(MediaTime time, MediaTime negativeThreshold, MediaTime positiveThreshold)
                                                                                                                      ^
                                                                                                            const    &
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:1174:55: warning: the parameter 'time' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void SourceBufferPrivateAVFObjC::seekToTime(MediaTime time)
                                                      ^
                                            const    &</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>