mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-24 07:53:41 +03:00
utf8::dump uses a copy of the output iterator instead of a reference
This commit is contained in:
parent
8e07e00f18
commit
9f9ad58b39
@ -25,8 +25,7 @@ public:
|
||||
explicit String(Codepoint cp, CharCount count = 1)
|
||||
{
|
||||
std::string str;
|
||||
auto it = back_inserter(str);
|
||||
utf8::dump(it, cp);
|
||||
utf8::dump(back_inserter(str), cp);
|
||||
for (CharCount i = 0; i < count; ++i)
|
||||
m_content += str;
|
||||
}
|
||||
@ -113,8 +112,7 @@ inline String operator"" _str(const char* str, size_t)
|
||||
inline String codepoint_to_str(Codepoint cp)
|
||||
{
|
||||
std::string str;
|
||||
auto it = back_inserter(str);
|
||||
utf8::dump(it, cp);
|
||||
utf8::dump(back_inserter(str), cp);
|
||||
return String(str);
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ Codepoint codepoint(Iterator it)
|
||||
struct invalid_codepoint{};
|
||||
|
||||
template<typename OutputIterator>
|
||||
void dump(OutputIterator& it, Codepoint cp)
|
||||
void dump(OutputIterator&& it, Codepoint cp)
|
||||
{
|
||||
if (cp <= 0x7F)
|
||||
*it++ = cp;
|
||||
|
Loading…
Reference in New Issue
Block a user