summaryrefslogtreecommitdiff
path: root/src/string.cpp
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/string.cpp
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 5246f7827..c23202acb 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -634,8 +634,8 @@ public:
this->char_itr = icu::BreakIterator::createCharacterInstance(icu::Locale(_current_language != NULL ? _current_language->isocode : "en"), status);
this->word_itr = icu::BreakIterator::createWordInstance(icu::Locale(_current_language != NULL ? _current_language->isocode : "en"), status);
- *this->utf16_str.Append() = '\0';
- *this->utf16_to_utf8.Append() = 0;
+ this->utf16_str.push_back('\0');
+ this->utf16_to_utf8.push_back(0);
}
virtual ~IcuStringIterator()
@@ -660,17 +660,17 @@ public:
WChar c = Utf8Consume(&s);
if (c < 0x10000) {
- *this->utf16_str.Append() = (UChar)c;
+ this->utf16_str.push_back((UChar)c);
} else {
/* Make a surrogate pair. */
- *this->utf16_str.Append() = (UChar)(0xD800 + ((c - 0x10000) >> 10));
- *this->utf16_str.Append() = (UChar)(0xDC00 + ((c - 0x10000) & 0x3FF));
- *this->utf16_to_utf8.Append() = idx;
+ this->utf16_str.push_back((UChar)(0xD800 + ((c - 0x10000) >> 10)));
+ this->utf16_str.push_back((UChar)(0xDC00 + ((c - 0x10000) & 0x3FF)));
+ this->utf16_to_utf8.push_back(idx);
}
- *this->utf16_to_utf8.Append() = idx;
+ this->utf16_to_utf8.push_back(idx);
}
- *this->utf16_str.Append() = '\0';
- *this->utf16_to_utf8.Append() = s - string_base;
+ this->utf16_str.push_back('\0');
+ this->utf16_to_utf8.push_back(s - string_base);
UText text = UTEXT_INITIALIZER;
UErrorCode status = U_ZERO_ERROR;