From e6e90fb8b837bef8a7141d1d61cb42d1e2774cc5 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 3 Sep 2014 21:45:44 -0700 Subject: [PATCH] Sync am-string. --- public/amtl/am-string.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/amtl/am-string.h b/public/amtl/am-string.h index 074339fa..4e62bde2 100644 --- a/public/amtl/am-string.h +++ b/public/amtl/am-string.h @@ -56,7 +56,7 @@ class AString if (other.length_) set(other.chars_, other.length_); else - length_ = 0; + length_ = 0; } AString(Moveable other) : chars_(other->chars_.take()), @@ -117,6 +117,8 @@ class AString } private: + static const size_t kInvalidLength = (size_t)-1; + void set(const char *str, size_t length) { chars_ = new char[length + 1]; length_ = length;