Sync am-string.
This commit is contained in:
parent
6068d341c8
commit
e6e90fb8b8
@ -56,7 +56,7 @@ class AString
|
|||||||
if (other.length_)
|
if (other.length_)
|
||||||
set(other.chars_, other.length_);
|
set(other.chars_, other.length_);
|
||||||
else
|
else
|
||||||
length_ = 0;
|
length_ = 0;
|
||||||
}
|
}
|
||||||
AString(Moveable<AString> other)
|
AString(Moveable<AString> other)
|
||||||
: chars_(other->chars_.take()),
|
: chars_(other->chars_.take()),
|
||||||
@ -117,6 +117,8 @@ class AString
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static const size_t kInvalidLength = (size_t)-1;
|
||||||
|
|
||||||
void set(const char *str, size_t length) {
|
void set(const char *str, size_t length) {
|
||||||
chars_ = new char[length + 1];
|
chars_ = new char[length + 1];
|
||||||
length_ = length;
|
length_ = length;
|
||||||
|
Loading…
Reference in New Issue
Block a user