| 674 | } |
| 675 | |
| 676 | BString 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 | |
| 690 | BString BString::operator+(const char* s) const { |
| 691 | if (isEmpty()) { |
nothing calls this directly
no test coverage detected