[Scummvm-cvs-logs] SF.net SVN: scummvm:[34615] scummvm/trunk/common/str.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Sep 20 17:53:21 CEST 2008
Revision: 34615
http://scummvm.svn.sourceforge.net/scummvm/?rev=34615&view=rev
Author: fingolfin
Date: 2008-09-20 15:53:17 +0000 (Sat, 20 Sep 2008)
Log Message:
-----------
Little readability tweak
Modified Paths:
--------------
scummvm/trunk/common/str.cpp
Modified: scummvm/trunk/common/str.cpp
===================================================================
--- scummvm/trunk/common/str.cpp 2008-09-20 15:03:37 UTC (rev 34614)
+++ scummvm/trunk/common/str.cpp 2008-09-20 15:53:17 UTC (rev 34615)
@@ -79,15 +79,17 @@
}
String::String(const String &str)
- : _size(str._size), _str(str.isStorageIntern() ? _storage : str._str) {
+ : _size(str._size) {
if (str.isStorageIntern()) {
// String in internal storage: just copy it
- memcpy(_storage, str._storage, sizeof(_storage));
+ memcpy(_storage, str._storage, _builtinCapacity);
+ _str = _storage;
} else {
// String in external storage: use refcount mechanism
str.incRefCount();
_extern._refCount = str._extern._refCount;
_extern._capacity = str._extern._capacity;
+ _str = str._str;
}
assert(_str != 0);
}
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