aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HashTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-12-13 12:46:05 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-13 18:18:47 +0000
commitdb402cab8b23f2f912f880af8be9f51605ad2bc7 (patch)
tree99ca6555e10c02fff7378c0ca08bd2d849eca9bf /tests/HashTest.cpp
parent0abc8b43fddf7dae83bbe698ae61e9c8bc930ee8 (diff)
add move semantics to SkTHash*
The more I look at std::unordered_map and co., the less I like them. I think we might want to bet on SkTHash*. As a simple first improvement, add move support. Next comes shrinking, and then I'll start moving over SkTDynamicHash users. BUG=skia:6053 Change-Id: Ifdb5d713aab66434ca271c7f18a0cbbb0720099c Reviewed-on: https://skia-review.googlesource.com/5943 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/HashTest.cpp')
-rw-r--r--tests/HashTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/HashTest.cpp b/tests/HashTest.cpp
index c9b1bc967b..4a884e3b5b 100644
--- a/tests/HashTest.cpp
+++ b/tests/HashTest.cpp
@@ -111,6 +111,13 @@ public:
*fCounter += 1;
}
+ CopyCounter(CopyCounter&& other) { *this = std::move(other); }
+ void operator=(CopyCounter&& other) {
+ fID = other.fID;
+ fCounter = other.fCounter;
+ }
+
+
bool operator==(const CopyCounter& other) const {
return fID == other.fID;
}