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

Method accept

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

Source from the content-addressed store, hash-verified

48 basic_string* self;
49 char* result;
50 void accept(NotNullStringHolderPtr& heap) {
51 if (heap.get().use_count() > 1) {
52 // COW: detach from shared data before returning mutable pointer
53 self->mStorage = NotNullStringHolderPtr(
54 fl::make_shared<StringHolder>(heap->data(), self->mLength));
55 result = self->heapData()->data();
56 } else {
57 result = heap->data();
58 }
59 }
60 void accept(ConstLiteral&) {
61 self->materialize();
62 result = self->hasHeapData() ? self->heapData()->data()

Callers

nothing calls this directly

Calls 6

materializeMethod · 0.80
hasHeapDataMethod · 0.80
use_countMethod · 0.45
getMethod · 0.45
dataMethod · 0.45
inlineBufferPtrMethod · 0.45

Tested by

no test coverage detected