aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-03 20:26:30 +0000
committerWillem Jan Palenstijn2009-10-03 20:26:30 +0000
commit90eebcd245ae06221a41477e2268f5a281c628d6 (patch)
tree78e91e3cbd0d427cbc4b88fcf60e9903b23c0a23
parent95959a88ef3b1f993ac3013df6233301fc542436 (diff)
downloadscummvm-rg350-90eebcd245ae06221a41477e2268f5a281c628d6.tar.gz
scummvm-rg350-90eebcd245ae06221a41477e2268f5a281c628d6.tar.bz2
scummvm-rg350-90eebcd245ae06221a41477e2268f5a281c628d6.zip
Use buffer in Common::String::printf slightly more efficiently
svn-id: r44562
-rw-r--r--common/str.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/str.cpp b/common/str.cpp
index c51c544556..834c4cd362 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -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);