<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - AX: richer text change notifications"
   href="https://bugs.webkit.org/show_bug.cgi?id=142719#c127">Comment # 127</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - AX: richer text change notifications"
   href="https://bugs.webkit.org/show_bug.cgi?id=142719">bug 142719</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=251658&amp;action=diff" name="attach_251658" title="patch">attachment 251658</a> <a href="attachment.cgi?id=251658&amp;action=edit" title="patch">[details]</a></span>
patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=251658&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=251658&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:1079
&gt; +    if (m_passwordNotificationsToPost.find(observableObject) == m_passwordNotificationsToPost.end()) {
&gt; +        m_passwordNotificationsToPost.insert(observableObject);</span >

This is not good, it’s a double lookup, once for find and then again for insert.

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.h:270
&gt; +    template &lt;class T = void&gt; struct RefPtrCompare : std::binary_function&lt;RefPtr&lt;T&gt;, RefPtr&lt;T&gt;, bool&gt; {
&gt; +        bool operator()(const RefPtr&lt;T&gt;&amp; x, const RefPtr&lt;T&gt;&amp; y) const { return x.get() &lt; y.get(); }
&gt; +    };</span >

No, please don’t add adapters to use std::set. Use the set data structure from WTF: HashSet or perhaps for your use ListHashSet.

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.h:288
&gt; +    std::set&lt;RefPtr&lt;AccessibilityObject&gt;, RefPtrCompare&lt;AccessibilityObject&gt;&gt; m_passwordNotificationsToPost;</span >

Please don’t use std::set in WebKit. You need to use one of the WebKit collections. Given that we probably want these notifications to have a stable order, you should be using ListHashSet.</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>