diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-02-05 09:13:07 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-02-05 09:13:07 +0000 |
| commit | 94cbd5a837edfdcf87b754f3a943c57fbd9c9c32 (patch) | |
| tree | 0b0f51cd571ec2a5ead868013757ddcd15790276 /src/string.hh | |
| parent | ff6eacffa3f5bb10e0bf0d31b3eabc7ac10fcd51 (diff) | |
More string usage cleanup
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/string.hh b/src/string.hh index 5b62bf12..638f30f9 100644 --- a/src/string.hh +++ b/src/string.hh @@ -102,6 +102,7 @@ public: String(const char* content, ByteCount len) : m_data(content, (size_t)(int)len) {} explicit String(Codepoint cp, CharCount count = 1) { + reserve(utf8::codepoint_size(cp) * (int)count); while (count-- > 0) utf8::dump(std::back_inserter(*this), cp); } @@ -252,13 +253,6 @@ inline String operator"" _str(const char* str, size_t) return String(str); } -inline String codepoint_to_str(Codepoint cp) -{ - String str; - utf8::dump(std::back_inserter(str), cp); - return str; -} - int str_to_int(StringView str); // throws on error Optional<int> str_to_int_ifp(StringView str); |
