diff options
author | Max Horn | 2006-04-14 22:29:51 +0000 |
---|---|---|
committer | Max Horn | 2006-04-14 22:29:51 +0000 |
commit | eb1459334fd11484a51561c7082e86cde5c8b492 (patch) | |
tree | 0c4230e9ef2efd79da91be82e4d34a7204c5672e | |
parent | ce4927244cd509d4327dfd7858ba338287306ad1 (diff) | |
download | scummvm-rg350-eb1459334fd11484a51561c7082e86cde5c8b492.tar.gz scummvm-rg350-eb1459334fd11484a51561c7082e86cde5c8b492.tar.bz2 scummvm-rg350-eb1459334fd11484a51561c7082e86cde5c8b492.zip |
Tiny optimization for empty strings, which avoids allocating a single byte just to store an empty string (we pass around empty strings in lots of places)
svn-id: r21892
-rw-r--r-- | common/str.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/str.cpp b/common/str.cpp index df68cb8801..05be3b9e6b 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -37,7 +37,7 @@ String::String(const char *str, int len) _refCount = new int(1); - if (str && len != 0) { + if (str && *str && len != 0) { if (len > 0) _capacity = _len = len; else |