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

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

Issue 1846473002: WTF: Implement move of Deques. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « third_party/WebKit/Source/wtf/DequeTest.cpp ('k') | third_party/WebKit/Source/wtf/HashSetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/HashMapTest.cpp
diff --git a/third_party/WebKit/Source/wtf/HashMapTest.cpp b/third_party/WebKit/Source/wtf/HashMapTest.cpp
index 540331424df431ccff4006a676cf86fb2eff1733..d12d81ef299922e0f566edb793b9174a266b4f5c 100644
--- a/third_party/WebKit/Source/wtf/HashMapTest.cpp
+++ b/third_party/WebKit/Source/wtf/HashMapTest.cpp
@@ -478,11 +478,19 @@ class CountCopy final {
public:
CountCopy() : m_counter(nullptr) { }
explicit CountCopy(int& counter) : m_counter(&counter) { }
- CountCopy(const CountCopy& other) : m_counter(other.m_counter)
+ CountCopy(const CountCopy& other)
+ : m_counter(other.m_counter)
{
if (m_counter)
++*m_counter;
}
+ CountCopy& operator=(const CountCopy& other)
+ {
+ m_counter = other.m_counter;
+ if (m_counter)
+ ++*m_counter;
+ return *this;
+ }
private:
int* m_counter;
« no previous file with comments | « third_party/WebKit/Source/wtf/DequeTest.cpp ('k') | third_party/WebKit/Source/wtf/HashSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698