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

Unified Diff: third_party/WebKit/Source/wtf/HashTable.cpp

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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
Index: third_party/WebKit/Source/wtf/HashTable.cpp
diff --git a/third_party/WebKit/Source/wtf/HashTable.cpp b/third_party/WebKit/Source/wtf/HashTable.cpp
index 1b5eed23dc29a6215b506498e253a903ecd2d970..03becaef6eaee197324a20b53e14cc8f43524b50 100644
--- a/third_party/WebKit/Source/wtf/HashTable.cpp
+++ b/third_party/WebKit/Source/wtf/HashTable.cpp
@@ -33,36 +33,39 @@ int HashTableStats::numRehashes;
int HashTableStats::numRemoves;
int HashTableStats::numReinserts;
-static Mutex& hashTableStatsMutex()
-{
- DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex);
- return mutex;
+static Mutex& hashTableStatsMutex() {
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex);
+ return mutex;
}
-void HashTableStats::recordCollisionAtCount(int count)
-{
- MutexLocker lock(hashTableStatsMutex());
- if (count > maxCollisions)
- maxCollisions = count;
- numCollisions++;
- collisionGraph[count]++;
+void HashTableStats::recordCollisionAtCount(int count) {
+ MutexLocker lock(hashTableStatsMutex());
+ if (count > maxCollisions)
+ maxCollisions = count;
+ numCollisions++;
+ collisionGraph[count]++;
}
-void HashTableStats::dumpStats()
-{
- MutexLocker lock(hashTableStatsMutex());
+void HashTableStats::dumpStats() {
+ MutexLocker lock(hashTableStatsMutex());
- dataLogF("\nWTF::HashTable statistics\n\n");
- dataLogF("%d accesses\n", numAccesses);
- dataLogF("%d total collisions, average %.2f probes per access\n", numCollisions, 1.0 * (numAccesses + numCollisions) / numAccesses);
- dataLogF("longest collision chain: %d\n", maxCollisions);
- for (int i = 1; i <= maxCollisions; i++) {
- dataLogF(" %d lookups with exactly %d collisions (%.2f%% , %.2f%% with this many or more)\n", collisionGraph[i], i, 100.0 * (collisionGraph[i] - collisionGraph[i+1]) / numAccesses, 100.0 * collisionGraph[i] / numAccesses);
- }
- dataLogF("%d rehashes\n", numRehashes);
- dataLogF("%d reinserts\n", numReinserts);
+ dataLogF("\nWTF::HashTable statistics\n\n");
+ dataLogF("%d accesses\n", numAccesses);
+ dataLogF("%d total collisions, average %.2f probes per access\n",
+ numCollisions, 1.0 * (numAccesses + numCollisions) / numAccesses);
+ dataLogF("longest collision chain: %d\n", maxCollisions);
+ for (int i = 1; i <= maxCollisions; i++) {
+ dataLogF(
+ " %d lookups with exactly %d collisions (%.2f%% , %.2f%% with this "
+ "many or more)\n",
+ collisionGraph[i], i,
+ 100.0 * (collisionGraph[i] - collisionGraph[i + 1]) / numAccesses,
+ 100.0 * collisionGraph[i] / numAccesses);
+ }
+ dataLogF("%d rehashes\n", numRehashes);
+ dataLogF("%d reinserts\n", numReinserts);
}
#endif
-} // namespace WTF
+} // namespace WTF
« no previous file with comments | « third_party/WebKit/Source/wtf/HashTable.h ('k') | third_party/WebKit/Source/wtf/HashTableDeletedValueType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698