[Scummvm-cvs-logs] SF.net SVN: scummvm: [21892] scummvm/trunk/common/str.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Apr 14 15:30:12 CEST 2006
Revision: 21892
Author: fingolfin
Date: 2006-04-14 15:29:51 -0700 (Fri, 14 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21892&view=rev
Log Message:
-----------
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)
Modified Paths:
--------------
scummvm/trunk/common/str.cpp
Modified: scummvm/trunk/common/str.cpp
===================================================================
--- scummvm/trunk/common/str.cpp 2006-04-14 22:03:44 UTC (rev 21891)
+++ scummvm/trunk/common/str.cpp 2006-04-14 22:29:51 UTC (rev 21892)
@@ -37,7 +37,7 @@
_refCount = new int(1);
- if (str && len != 0) {
+ if (str && *str && len != 0) {
if (len > 0)
_capacity = _len = len;
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list