Use buffer in Common::String::printf slightly more efficiently

svn-id: r44562
This commit is contained in:
Willem Jan Palenstijn 2009-10-03 20:26:30 +00:00
parent 95959a88ef
commit 90eebcd245

View File

@ -457,6 +457,9 @@ String String::printf(const char *fmt, ...) {
do {
size *= 2;
output.ensureCapacity(size-1, false);
assert(!output.isStorageIntern());
size = output._extern._capacity;
va_start(va, fmt);
len = vsnprintf(output._str, size, fmt, va);
va_end(va);