mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 09:22:42 +01:00
Codechange: use std::span over char* for writing the buffers
This commit is contained in:
@@ -32,12 +32,12 @@
|
||||
/**
|
||||
* Append buffer.
|
||||
*/
|
||||
void InPlaceBuilder::PutBuffer(const char *str, size_type len)
|
||||
void InPlaceBuilder::PutBuffer(std::span<const char> str)
|
||||
{
|
||||
auto unused = this->GetBytesUnused();
|
||||
if (len > unused) NOT_REACHED();
|
||||
std::copy(str, str + len, this->dest.data() + this->position);
|
||||
this->position += len;
|
||||
if (str.size() > unused) NOT_REACHED();
|
||||
std::ranges::copy(str, this->dest.data() + this->position);
|
||||
this->position += str.size();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user