diff options
author | bungeman <bungeman@google.com> | 2016-02-07 18:42:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-07 18:42:54 -0800 |
commit | 9d55297f1fd1ed0f74277fd95b4c59608220aa77 (patch) | |
tree | 9c73024de69e737bb268984dfcbd02b20f06084f /include | |
parent | ccce0e02576100e1baaab6b18d91acaff624753e (diff) |
Make SkString movable.
This adds a move constructor and move assignment to SkString. This
allows elision of atomic increments and decrements on the fRec.
TBR=reed
Already agreed that moving is good.
Review URL: https://codereview.chromium.org/1672123002
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkString.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/core/SkString.h b/include/core/SkString.h index 93514f2659..4625dd13cc 100644 --- a/include/core/SkString.h +++ b/include/core/SkString.h @@ -126,6 +126,7 @@ public: explicit SkString(const char text[]); SkString(const char text[], size_t len); SkString(const SkString&); + SkString(SkString&&); ~SkString(); bool isEmpty() const { return 0 == fRec->fLength; } @@ -172,6 +173,7 @@ public: // these methods edit the string SkString& operator=(const SkString&); + SkString& operator=(SkString&&); SkString& operator=(const char text[]); char* writable_str(); |