Bug 700498 - Change StringBuffer::append to take a JSLinearString*, not a JSAtom*. r=cdleary

This commit is contained in:
Jeff Walden 2011-11-07 16:28:37 -08:00
Родитель 608bc07ca3
Коммит 3e76d21379
1 изменённых файлов: 5 добавлений и 10 удалений

Просмотреть файл

@ -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