MCPcopy Create free account
hub / github.com/FastLED/FastLED / copy

Method copy

src/fl/stl/basic_string.cpp.hpp:344–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342// ======= COPY =======
343
344void basic_string::copy(const char* str) {
345 fl::size len = fl::strlen(str);
346 mLength = len;
347 if (len + 1 <= mInlineCapacity) {
348 if (!isInline()) {
349 mStorage.reset();
350 }
351 fl::memcpy(inlineBufferPtr(), str, len + 1);
352 } else {
353 if (hasHeapData() && heapData().get().use_count() <= 1) {
354 heapData()->copy(str, len);
355 return;
356 }
357 mStorage = NotNullStringHolderPtr(fl::make_shared<StringHolder>(str));
358 }
359}
360
361void basic_string::copy(const char* str, fl::size len) {
362 mLength = len;

Callers 2

copy_no_viewMethod · 0.45
substringMethod · 0.45

Calls 8

strlenFunction · 0.85
hasHeapDataMethod · 0.80
memcpyFunction · 0.50
resetMethod · 0.45
use_countMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected