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>
diff --git a/tests/HashTest.cpp b/tests/HashTest.cpp
index c9b1bc9..4a884e3 100644
--- a/tests/HashTest.cpp
+++ b/tests/HashTest.cpp
@@ -111,6 +111,13 @@
*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;
}