mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 20:12:42 +00:00
Codechange: use std::span over char* for writing the buffers
This commit is contained in:
@@ -113,13 +113,13 @@ void BaseStringBuilder::PutChar(char c)
|
||||
void BaseStringBuilder::PutUtf8(char32_t c)
|
||||
{
|
||||
auto [buf, len] = EncodeUtf8(c);
|
||||
this->PutBuffer(buf, len);
|
||||
this->PutBuffer({buf, len});
|
||||
}
|
||||
|
||||
/**
|
||||
* Append buffer.
|
||||
*/
|
||||
void StringBuilder::PutBuffer(const char *str, size_type len)
|
||||
void StringBuilder::PutBuffer(std::span<const char> str)
|
||||
{
|
||||
this->dest->append(str, len);
|
||||
this->dest->append(str.data(), str.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user