Changeset 81 for cpp/gdk/sstring.cpp
- Timestamp:
- 02/08/13 03:29:17 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/sstring.cpp
r66 r81 5 5 6 6 #include "sstring.h" 7 #include "nonstd .h"7 #include "nonstd_stl.h" 8 8 9 9 … … 120 120 void SString::initEmpty() 121 121 { 122 buf=&SBuf::empty ;122 buf=&SBuf::empty(); 123 123 memhint=-1; 124 124 } … … 131 131 void SString::detachEmpty(int ensuresize) 132 132 { 133 if (buf==&SBuf::empty ) { buf=new SBuf(ensuresize,memhint); return; }133 if (buf==&SBuf::empty()) { buf=new SBuf(ensuresize,memhint); return; } 134 134 if (buf->refcount<2) buf->ensureSize(ensuresize,memhint); 135 135 else … … 142 142 void SString::detach() 143 143 { 144 if (buf==&SBuf::empty ) return;144 if (buf==&SBuf::empty()) return; 145 145 if (!--buf->refcount) delete buf; 146 146 } … … 148 148 void SString::detachCopy(int ensuresize) 149 149 { 150 if (buf==&SBuf::empty ) { buf=new SBuf(ensuresize,memhint); return; }150 if (buf==&SBuf::empty()) { buf=new SBuf(ensuresize,memhint); return; } 151 151 if (buf->refcount<2) 152 152 { … … 319 319 } 320 320 321 322 SString SString::empty; 323 SBuf SBuf::empty; 321 SString &SString::empty() 322 { 323 static SString empty; 324 return empty; 325 } 326 327 SBuf &SBuf::empty() 328 { 329 static SBuf empty; 330 return empty; 331 }
Note: See TracChangeset
for help on using the changeset viewer.