Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1239)

Unified Diff: Source/core/inspector/AsyncCallStackTracker.cpp

Issue 167123002: Simpler return value from HashTable::add()/HashMap::add() and others (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/forms/FormController.cpp ('k') | Source/core/inspector/DOMPatchSupport.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/AsyncCallStackTracker.cpp
diff --git a/Source/core/inspector/AsyncCallStackTracker.cpp b/Source/core/inspector/AsyncCallStackTracker.cpp
index e93fdc5f85701c61cc24c6d545607df3cbb00ab4..a8761a9d945f9aceeb343e08ddf7e0da94fdde65 100644
--- a/Source/core/inspector/AsyncCallStackTracker.cpp
+++ b/Source/core/inspector/AsyncCallStackTracker.cpp
@@ -80,13 +80,17 @@ public:
void addEventListenerData(EventTarget* eventTarget, const AtomicString& eventType, const EventListenerAsyncCallChain& item)
{
HashMap<EventTarget*, EventListenerAsyncCallChainVectorHashMap>::iterator it = m_eventTargetCallChains.find(eventTarget);
+ EventListenerAsyncCallChainVectorHashMap* mapPtr;
if (it == m_eventTargetCallChains.end())
- it = m_eventTargetCallChains.set(eventTarget, EventListenerAsyncCallChainVectorHashMap()).iterator;
- EventListenerAsyncCallChainVectorHashMap& map = it->value;
+ mapPtr = &m_eventTargetCallChains.set(eventTarget, EventListenerAsyncCallChainVectorHashMap()).storedValue->value;
+ else
+ mapPtr = &it->value;
+ EventListenerAsyncCallChainVectorHashMap& map = *mapPtr;
EventListenerAsyncCallChainVectorHashMap::iterator it2 = map.find(eventType);
if (it2 == map.end())
- it2 = map.set(eventType, EventListenerAsyncCallChainVector()).iterator;
- it2->value.append(item);
+ map.set(eventType, EventListenerAsyncCallChainVector()).storedValue->value.append(item);
+ else
+ it2->value.append(item);
}
void removeEventListenerData(EventTarget* eventTarget, const AtomicString& eventType, const RegisteredEventListener& item)
« no previous file with comments | « Source/core/html/forms/FormController.cpp ('k') | Source/core/inspector/DOMPatchSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698