зеркало из https://github.com/mozilla/gecko-dev.git
Bug 700498 - Change StringBuffer::append to take a JSLinearString*, not a JSAtom*. r=cdleary
This commit is contained in:
Родитель
608bc07ca3
Коммит
3e76d21379
|
@ -77,7 +77,7 @@ class StringBuffer
|
|||
bool append(const jschar *chars, size_t len);
|
||||
bool append(const jschar *begin, const jschar *end);
|
||||
bool append(JSString *str);
|
||||
bool append(JSAtom *atom);
|
||||
bool append(JSLinearString *str);
|
||||
bool appendN(const jschar c, size_t n);
|
||||
bool appendInflated(const char *cstr, size_t len);
|
||||
|
||||
|
@ -173,19 +173,14 @@ StringBuffer::append(JSString *str)
|
|||
JSLinearString *linear = str->ensureLinear(context());
|
||||
if (!linear)
|
||||
return false;
|
||||
size_t strLen = linear->length();
|
||||
if (!checkLength(cb.length() + strLen))
|
||||
return false;
|
||||
return cb.append(linear->chars(), strLen);
|
||||
return append(linear);
|
||||
}
|
||||
|
||||
inline bool
|
||||
StringBuffer::append(JSAtom *atom)
|
||||
StringBuffer::append(JSLinearString *str)
|
||||
{
|
||||
size_t strLen = atom->length();
|
||||
if (!checkLength(cb.length() + strLen))
|
||||
return false;
|
||||
return cb.append(atom->chars(), strLen);
|
||||
JS::Anchor<JSString *> anch(str);
|
||||
return cb.append(str->chars(), str->length());
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче