mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Modernize various files (part 2)
* range-based for loops * emplace_back instead of push_back * code style * C++ headers instead of C headers * Default operators * empty stl function
This commit is contained in:
parent
55ab4264dc
commit
1d086aee7c
10 changed files with 107 additions and 152 deletions
|
@ -13,11 +13,9 @@ void ItemStackMetadata::serialize(std::ostream &os) const
|
|||
{
|
||||
std::ostringstream os2;
|
||||
os2 << DESERIALIZE_START;
|
||||
for (StringMap::const_iterator
|
||||
it = m_stringvars.begin();
|
||||
it != m_stringvars.end(); ++it) {
|
||||
os2 << it->first << DESERIALIZE_KV_DELIM
|
||||
<< it->second << DESERIALIZE_PAIR_DELIM;
|
||||
for (const auto &stringvar : m_stringvars) {
|
||||
os2 << stringvar.first << DESERIALIZE_KV_DELIM
|
||||
<< stringvar.second << DESERIALIZE_PAIR_DELIM;
|
||||
}
|
||||
os << serializeJsonStringIfNeeded(os2.str());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue