Index: compiled/String.h |
=================================================================== |
--- a/compiled/String.h |
+++ b/compiled/String.h |
@@ -344,16 +344,28 @@ public: |
return; |
assert(source, u"Null buffer passed to OwnedString.append()"_str); |
size_t oldLength = length(); |
grow(sourceLen); |
std::memcpy(mBuf + oldLength, source, sizeof(value_type) * sourceLen); |
} |
+ void append(const char* source, size_type sourceLen) |
+ { |
+ if (!sourceLen) |
+ return; |
+ |
+ assert(source, u"Null buffer passed to OwnedString.append()"_str); |
+ size_t oldLength = length(); |
+ grow(sourceLen); |
+ for (size_t i = 0; i < sourceLen; i++) |
+ mBuf[oldLength + i] = source[i]; |
+ } |
+ |
void append(const String& str) |
{ |
append(str.mBuf, str.length()); |
} |
void append(value_type c) |
{ |
append(&c, 1); |
@@ -366,17 +378,17 @@ public: |
bool negative = false; |
if (num < 0) |
{ |
negative = true; |
num = -num; |
} |
size_type size = 0; |
- for (int i = num; i; i /= 10) |
+ for (T i = num; i; i /= 10) |
Wladimir Palant
2017/04/07 07:14:57
Yep, fixed a stupid mistake here.
|
size++; |
size = (size ? size : 1); |
size_type pos = length(); |
grow((negative ? 1 : 0) + size); |
if (negative) |
mBuf[pos++] = '-'; |