| 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() |
nothing calls this directly
no test coverage detected