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

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

Issue 69343003: Use a HashCountedSet to count identifiers in InspectorConsoleAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/inspector/InspectorConsoleAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorConsoleAgent.cpp
diff --git a/Source/core/inspector/InspectorConsoleAgent.cpp b/Source/core/inspector/InspectorConsoleAgent.cpp
index 2cb5495283ccdb69307be2cebf9ca4642486450e..1aa15470f2db8f4316f824f1dbfaff5e5f718937 100644
--- a/Source/core/inspector/InspectorConsoleAgent.cpp
+++ b/Source/core/inspector/InspectorConsoleAgent.cpp
@@ -243,18 +243,8 @@ void InspectorConsoleAgent::consoleCount(ScriptState* state, PassRefPtr<ScriptAr
String identifier = title.isEmpty() ? String(lastCaller.sourceURL() + ':' + String::number(lastCaller.lineNumber()))
: String(title + '@');
- HashMap<String, unsigned>::iterator it = m_counts.find(identifier);
- int count;
- if (it == m_counts.end())
- count = 1;
- else {
- count = it->value + 1;
- m_counts.remove(it);
- }
-
- m_counts.add(identifier, count);
-
- String message = title + ": " + String::number(count);
+ HashCountedSet<String>::AddResult result = m_counts.add(identifier);
+ String message = title + ": " + String::number(result.iterator->value);
addMessageToConsole(ConsoleAPIMessageSource, LogMessageType, DebugMessageLevel, message, callStack);
}
« no previous file with comments | « Source/core/inspector/InspectorConsoleAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698