367 {
368
369
370
371
372
374 bool other_inline = other.isInline();
375
376 if (!this_inline && !other_inline) {
377
380 other.mArray = tmp_array;
381
384 other.mCapacity = tmp_cap;
385 } else if (this_inline && other_inline) {
386
387 fl::size max_size =
mSize > other.mSize ?
mSize : other.mSize;
388 for (fl::size i = 0; i < max_size; ++i) {
389 if (i <
mSize && i < other.mSize) {
392 } else {
394 }
395 }
else if (i <
mSize) {
396
400 } else {
402 }
403 } else {
404
407 mOps->destroy_n(other.element_ptr(i), 1);
408 } else {
410 }
411 }
412 }
413 } else if (this_inline) {
414
415
416
417 void* other_array = other.mArray;
418 fl::size other_cap = other.mCapacity;
419
420
421 if (other.hasInlineBuffer() &&
mSize <= other.mInlineCapacity) {
422 other.mArray = other.inlineBufferPtr();
423 other.mCapacity = other.mInlineCapacity;
427 } else {
429 }
430 } else {
431
433 other.mCapacity =
mSize;
437 } else {
439 }
440 }
441
442
445 } else {
446
447 other.swap_impl(*this);
448 return;
449 }
450
451
452 fl::size tmp_size =
mSize;
454 other.mSize = tmp_size;
455
456
459 other.mResource = tmp_res;
460}
const vector_element_ops * mOps
void trivial_swap(void *a, void *b) const FL_NO_EXCEPT
void trivial_copy(void *dst, const void *src, fl::size count) const FL_NO_EXCEPT
void * element_ptr(fl::size index) FL_NO_EXCEPT
Pointer to element at index (byte arithmetic).
bool isInline() const FL_NO_EXCEPT
Is data currently in the inline buffer?
memory_resource * mResource
void uninitialized_move_n_impl(void *dst, void *src, fl::size count) const FL_NO_EXCEPT
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT