Changeset 36561 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 5, 2011 1:42:59 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70996
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r36544 r36561 368 368 if (a_rList.size() > 1) 369 369 { 370 /* calc the required size */ 371 size_t cbNeeded = a_rstrSep.length() * (a_rList.size() - 1) + 1; 372 for (size_t i = 0; i < a_rList.size(); ++i) 373 cbNeeded += a_rList.at(i).length(); 374 strRet.reserve(cbNeeded); 375 376 /* do the appending. */ 370 377 for (size_t i = 0; i < a_rList.size() - 1; ++i) 371 strRet += a_rList.at(i) + a_rstrSep; 372 } 373 if (a_rList.size() > 0) 374 strRet += a_rList.last(); 378 { 379 strRet.append(a_rList.at(i)); 380 strRet.append(a_rstrSep); 381 } 382 strRet.append(a_rList.last()); 383 } 384 /* special case: one list item. */ 385 else if (a_rList.size() > 0) 386 strRet.append(a_rList.last()); 375 387 376 388 return strRet;
Note:
See TracChangeset
for help on using the changeset viewer.