Move when swapping, if possible.
This change was avoided in the past because vc++ 2013 (12.0)
did not properly create default move constructors and
move assignment operators.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2454763002
TBR=reed
Verbal lgtm
Review-Url: https://codereview.chromium.org/2454763002
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 0cef8a1..0a3e3ac 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -396,9 +396,9 @@
/** Generic swap function. Classes with efficient swaps should specialize this function to take
their fast path. This function is used by SkTSort. */
template <typename T> inline void SkTSwap(T& a, T& b) {
- T c(a);
- a = b;
- b = c;
+ T c(std::move(a));
+ a = std::move(b);
+ b = std::move(c);
}
static inline int32_t SkAbs32(int32_t value) {