From eb1459334fd11484a51561c7082e86cde5c8b492 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 14 Apr 2006 22:29:51 +0000 Subject: 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 --- common/str.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3