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

Unified Diff: include/core/SkTypes.h

Issue 2454763002: Move when swapping, if possible. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | src/core/SkTSort.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 0cef8a125702d6f7d3df663d7b4a5be3aa3bdabf..0a3e3ac4871b702fba2e9aa208ede0cff378b329 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -396,9 +396,9 @@ static inline constexpr int Sk32ToBool(uint32_t n) {
/** 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) {
« no previous file with comments | « no previous file | src/core/SkTSort.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698