- Timestamp:
- Oct 20, 2021, 4:38:37 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 4e8df745
- Parents:
- 0ca15b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/string_res.cfa
r0ca15b7 r2b30370 209 209 // Store auto-newline state so it can be restored 210 210 bool anl = getANL$(out); 211 nlOff(out); 212 for (size_t i = 0; i < s.Handle.lnth; i++) { 213 // Need to re-apply on the last output operator, for whole-statement version 214 if (anl && i == s.Handle.lnth-1) nlOn(out); 215 out | s[i]; 216 } 217 return out; 211 if( s.Handle.lnth == 0 ) { 212 sout | ""; 213 } else { 214 nlOff(out); 215 for (size_t i = 0; i < s.Handle.lnth; i++) { 216 // Need to re-apply on the last output operator, for whole-statement version 217 if (anl && i == s.Handle.lnth-1) nlOn(out); 218 out | s[i]; 219 } 220 } 218 221 } 219 222 … … 223 226 (Handle){ * ambient_string_sharectx->activeHeap }; 224 227 (shareEditSet_owns_ulink){ false }; 228 verify( Handle.s == 0p && Handle.lnth == 0 ); 225 229 } else { 226 230 (Handle){ * new( (size_t) 10 ) }; // TODO: can I lazily avoid allocating for empty string 227 231 (shareEditSet_owns_ulink){ true }; 232 Handle.s = Handle.ulink->StartVbyte; 233 verify( Handle.lnth == 0 ); 228 234 } 229 235 s.shareEditSet_prev = &s;
Note: See TracChangeset
for help on using the changeset viewer.