Changeset 223317 in webkit
- Timestamp:
- Oct 14, 2017 8:07:44 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r223316 r223317 1 2017-10-14 Sam Weinig <sam@webkit.org> 2 3 Remove HashCountedSet's copyToVector functions 4 https://bugs.webkit.org/show_bug.cgi?id=178215 5 6 Reviewed by Daniel Bates. 7 8 * wtf/HashCountedSet.h: 9 (WTF::copyToVector): Deleted. 10 11 They are replaced by either copyToVector(hashCountedSet) or copyToVector(hashCountedSet.values()) 12 1 13 2017-10-13 Sam Weinig <sam@webkit.org> 2 14 -
trunk/Source/WTF/wtf/HashCountedSet.h
r223316 r223317 310 310 } 311 311 312 template<typename Value, typename HashFunctions, typename Traits, typename VectorType>313 inline void copyToVector(const HashCountedSet<Value, HashFunctions, Traits>& collection, VectorType& vector)314 {315 typedef typename HashCountedSet<Value, HashFunctions, Traits>::const_iterator iterator;316 317 vector.resize(collection.size());318 319 iterator it = collection.begin();320 iterator end = collection.end();321 for (unsigned i = 0; it != end; ++it, ++i)322 vector[i] = *it;323 }324 325 template<typename Value, typename HashFunctions, typename Traits>326 inline void copyToVector(const HashCountedSet<Value, HashFunctions, Traits>& collection, Vector<Value>& vector)327 {328 typedef typename HashCountedSet<Value, HashFunctions, Traits>::const_iterator iterator;329 330 vector.resize(collection.size());331 332 iterator it = collection.begin();333 iterator end = collection.end();334 for (unsigned i = 0; it != end; ++it, ++i)335 vector[i] = (*it).key;336 }337 338 312 } // namespace WTF 339 313 340 314 using WTF::HashCountedSet; 341 342 -
trunk/Source/WebCore/ChangeLog
r223315 r223317 1 2017-10-14 Sam Weinig <sam@webkit.org> 2 3 Remove HashCountedSet's copyToVector functions 4 https://bugs.webkit.org/show_bug.cgi?id=178215 5 6 Reviewed by Daniel Bates. 7 8 * page/DeviceController.cpp: 9 (WebCore::DeviceController::dispatchDeviceEvent): 10 (WebCore::DeviceController::fireDeviceEvent): 11 12 Replace use of HashCountedSet's copyToVector functions with copyToVector(hashCountedSet.values()). 13 1 14 2017-10-13 Jer Noble <jer.noble@apple.com> 2 15 -
trunk/Source/WebCore/page/DeviceController.cpp
r215160 r223317 73 73 void DeviceController::dispatchDeviceEvent(Event& event) 74 74 { 75 Vector<RefPtr<DOMWindow>> listenerVector; 76 copyToVector(m_listeners, listenerVector); 77 for (auto& listener : listenerVector) { 75 for (auto& listener : copyToVector(m_listeners.values())) { 78 76 auto document = listener->document(); 79 77 if (document && !document->activeDOMObjectsAreSuspended() && !document->activeDOMObjectsAreStopped()) … … 87 85 88 86 m_timer.stop(); 89 Vector<RefPtr<DOMWindow>> listenerVector; 90 copyToVector(m_lastEventListeners, listenerVector); 87 auto listenerVector = copyToVector(m_lastEventListeners.values()); 91 88 m_lastEventListeners.clear(); 92 89 for (auto& listener : listenerVector) {
Note: See TracChangeset
for help on using the changeset viewer.