<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@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=251658&action=diff" name="attach_251658" title="patch">attachment 251658</a> <a href="attachment.cgi?id=251658&action=edit" title="patch">[details]</a></span>
patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=251658&action=review">https://bugs.webkit.org/attachment.cgi?id=251658&action=review</a>
<span class="quote">> Source/WebCore/accessibility/AXObjectCache.cpp:1079
> + if (m_passwordNotificationsToPost.find(observableObject) == m_passwordNotificationsToPost.end()) {
> + 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">> Source/WebCore/accessibility/AXObjectCache.h:270
> + template <class T = void> struct RefPtrCompare : std::binary_function<RefPtr<T>, RefPtr<T>, bool> {
> + bool operator()(const RefPtr<T>& x, const RefPtr<T>& y) const { return x.get() < y.get(); }
> + };</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">> Source/WebCore/accessibility/AXObjectCache.h:288
> + std::set<RefPtr<AccessibilityObject>, RefPtrCompare<AccessibilityObject>> 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>