diff options
author | Mike Klein <mtklein@chromium.org> | 2016-12-13 12:46:05 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-13 18:18:47 +0000 |
commit | db402cab8b23f2f912f880af8be9f51605ad2bc7 (patch) | |
tree | 99ca6555e10c02fff7378c0ca08bd2d849eca9bf /tests/HashTest.cpp | |
parent | 0abc8b43fddf7dae83bbe698ae61e9c8bc930ee8 (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.cpp | 7 |
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; } |