summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-02-18 22:39:06 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commita0f36a50e6324f570985f5010eb0543ec0673aeb (patch)
tree09f9c9abd097acc244f80366da42cb8702c7ed19 /src/strgen
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen_base.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp
index 0e75537fb..12d993844 100644
--- a/src/strgen/strgen_base.cpp
+++ b/src/strgen/strgen_base.cpp
@@ -242,7 +242,7 @@ struct Buffer : SmallVector<byte, 256> {
*/
void AppendByte(byte value)
{
- *this->Append() = value;
+ this->push_back(value);
}
/**
@@ -252,19 +252,19 @@ struct Buffer : SmallVector<byte, 256> {
void AppendUtf8(uint32 value)
{
if (value < 0x80) {
- *this->Append() = value;
+ this->push_back(value);
} else if (value < 0x800) {
- *this->Append() = 0xC0 + GB(value, 6, 5);
- *this->Append() = 0x80 + GB(value, 0, 6);
+ this->push_back(0xC0 + GB(value, 6, 5));
+ this->push_back(0x80 + GB(value, 0, 6));
} else if (value < 0x10000) {
- *this->Append() = 0xE0 + GB(value, 12, 4);
- *this->Append() = 0x80 + GB(value, 6, 6);
- *this->Append() = 0x80 + GB(value, 0, 6);
+ this->push_back(0xE0 + GB(value, 12, 4));
+ this->push_back(0x80 + GB(value, 6, 6));
+ this->push_back(0x80 + GB(value, 0, 6));
} else if (value < 0x110000) {
- *this->Append() = 0xF0 + GB(value, 18, 3);
- *this->Append() = 0x80 + GB(value, 12, 6);
- *this->Append() = 0x80 + GB(value, 6, 6);
- *this->Append() = 0x80 + GB(value, 0, 6);
+ this->push_back(0xF0 + GB(value, 18, 3));
+ this->push_back(0x80 + GB(value, 12, 6));
+ this->push_back(0x80 + GB(value, 6, 6));
+ this->push_back(0x80 + GB(value, 0, 6));
} else {
strgen_warning("Invalid unicode value U+0x%X", value);
}