FastLED 3.10.6
Loading...
Searching...
No Matches

◆ resize() [2/2]

void fl::basic_string::resize ( fl::size count,
char ch )

Definition at line 1461 of file basic_string.cpp.hpp.

1461 {
1462 if (count < mLength) {
1463 mLength = count;
1464 c_str_mutable()[mLength] = '\0';
1465 } else if (count > mLength) {
1466 fl::size additional_chars = count - mLength;
1467 reserve(count);
1468 char* data_ptr = c_str_mutable();
1469 for (fl::size i = 0; i < additional_chars; ++i) {
1470 data_ptr[mLength + i] = ch;
1471 }
1472 mLength = count;
1473 data_ptr[mLength] = '\0';
1474 }
1475}
char * c_str_mutable() FL_NO_EXCEPT
void reserve(fl::size newCapacity) FL_NO_EXCEPT

References c_str_mutable(), mLength, and reserve().

+ Here is the call graph for this function: