MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / operator+

Method operator+

source/util/bstring.cpp:676–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676BString BString::operator+(const BString& s) const {
677 if (isEmpty()) {
678 return s;
679 }
680 BStringData* d = allocNewData();
681 d->len = length() + s.length();
682 d->level = powerOf2(d->len + 1);
683 d->str = getNewString(d->level);
684 memcpy(d->str, data->str, data->len);
685 memcpy(d->str + data->len, s.data->str, s.length());
686 d->str[d->len] = 0;
687 return BString(d);
688}
689
690BString BString::operator+(const char* s) const {
691 if (isEmpty()) {

Callers

nothing calls this directly

Calls 7

allocNewDataFunction · 0.85
lengthFunction · 0.85
getNewStringFunction · 0.85
memcpyFunction · 0.85
BStringClass · 0.85
powerOf2Function · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected