<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: loop variable is copied but only used as const reference in Document.cpp, Element.cpp"
   href="https://bugs.webkit.org/show_bug.cgi?id=192661">192661</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
          </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>URL</th>
          <td>http://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html
          </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>HTML DOM
          </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>ajuma@chromium.org, cdumez@apple.com, simon.fraser@apple.com
          </td>
        </tr>

        <tr>
          <th>Depends on</th>
          <td>188670
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Running `clang-tidy '-checks=-*,performance-for-range-copy' ...` on Document.cpp and Element.cpp finds these unnecessary copies:

Source/WebCore/dom/Document.cpp:7907:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto observer : m_intersectionObserversWithPendingNotifications) {
              ^
         const  &

Source/WebCore/dom/Element.cpp:1777:19: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
        for (auto observer : observerData->observers) {
                  ^
             const  &
Source/WebCore/dom/Element.cpp:3399:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto observer : observerData->observers)
              ^
         const  &</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [IntersectionObserver] Fire an initial dummy notification"
   href="https://bugs.webkit.org/show_bug.cgi?id=188670">Bug 188670</a>] [IntersectionObserver] Fire an initial dummy notification
              </li>
          </ul>
        </div>
        <br>

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

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