summaryrefslogtreecommitdiff
path: root/src/stringfilter.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-12-15 00:22:04 +0100
committerMichael Lutz <michi@icosahedron.de>2020-12-15 00:29:30 +0100
commit79240eab1ee4abb2882a40c7ac18e4915b4dc820 (patch)
tree98abb3c8ccf490efa459ed29fe7f28699c8d9928 /src/stringfilter.cpp
parentcc1679e3171bf6982164c4072a773fdd687ea885 (diff)
downloadopenttd-79240eab1ee4abb2882a40c7ac18e4915b4dc820.tar.xz
Codechange: Make use of the improved C++17 emplace_back function.
Diffstat (limited to 'src/stringfilter.cpp')
-rw-r--r--src/stringfilter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/stringfilter.cpp b/src/stringfilter.cpp
index 30876a82d..4765a880e 100644
--- a/src/stringfilter.cpp
+++ b/src/stringfilter.cpp
@@ -74,8 +74,7 @@ void StringFilter::SetFilterTerm(const char *str)
/* Add to word */
if (word == nullptr) {
- /*C++17: word = &*/ this->word_index.push_back({dest, false});
- word = &this->word_index.back();
+ word = &this->word_index.emplace_back(WordState{ dest, false });
}
memcpy(dest, pos, len);