diff options
author | bungeman <bungeman@google.com> | 2015-08-31 14:36:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-31 14:36:48 -0700 |
commit | b2885d59bccb1c5045e52135c5dd7a85a57694fa (patch) | |
tree | bace36ee35c1329238e7ea715c045ac8d0a595c3 /include/core | |
parent | 46b42f5304e883f6337b4fd435b3dcd63ade3612 (diff) |
Document SkString::resize(int) as destructive.
It is easy to think in some cases that SkString::resize(int) is not
destructive, since optimizations mean that most of the time the data
is still there after a resize. However, in the general case, the
original string's data is lost and the new SkString contains garbage.
Review URL: https://codereview.chromium.org/1304833004
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkString.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/core/SkString.h b/include/core/SkString.h index ea73e09823..9229d808a6 100644 --- a/include/core/SkString.h +++ b/include/core/SkString.h @@ -178,6 +178,7 @@ public: char& operator[](size_t n) { return this->writable_str()[n]; } void reset(); + /** Destructive resize, does not preserve contents. */ void resize(size_t len) { this->set(NULL, len); } void set(const SkString& src) { *this = src; } void set(const char text[]); |