mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Make use of emplace_back's return value. (#13879)
parent
5aa4ad5135
commit
42eb513897
|
@ -301,8 +301,8 @@ void GameStrings::Compile()
|
||||||
translation_reader.ParseFile();
|
translation_reader.ParseFile();
|
||||||
if (_errors != 0) throw std::exception();
|
if (_errors != 0) throw std::exception();
|
||||||
|
|
||||||
this->compiled_strings.emplace_back(p.language);
|
auto &strings = this->compiled_strings.emplace_back(p.language);
|
||||||
TranslationWriter writer(this->compiled_strings.back().lines);
|
TranslationWriter writer(strings.lines);
|
||||||
writer.WriteLang(data);
|
writer.WriteLang(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -786,8 +786,8 @@ struct MpsMachine {
|
||||||
this->tempo_ticks = this->current_tempo;
|
this->tempo_ticks = this->current_tempo;
|
||||||
|
|
||||||
/* Always reset percussion channel to program 0 */
|
/* Always reset percussion channel to program 0 */
|
||||||
this->target.blocks.push_back(MidiFile::DataBlock());
|
auto &data_block = this->target.blocks.emplace_back();
|
||||||
AddMidiData(this->target.blocks.back(), MIDIST_PROGCHG + 9, 0x00);
|
AddMidiData(data_block, MIDIST_PROGCHG + 9, 0x00);
|
||||||
|
|
||||||
/* Technically should be an endless loop, but having
|
/* Technically should be an endless loop, but having
|
||||||
* a maximum (about 10 minutes) avoids getting stuck,
|
* a maximum (about 10 minutes) avoids getting stuck,
|
||||||
|
|
|
@ -86,8 +86,8 @@ public:
|
||||||
/* Edge data is now a simple vector and not any kind of matrix. */
|
/* Edge data is now a simple vector and not any kind of matrix. */
|
||||||
size_t size = SlGetStructListLength(UINT16_MAX);
|
size_t size = SlGetStructListLength(UINT16_MAX);
|
||||||
for (size_t i = 0; i < size; i++) {
|
for (size_t i = 0; i < size; i++) {
|
||||||
bn->edges.emplace_back();
|
auto &edge = bn->edges.emplace_back();
|
||||||
SlObject(&bn->edges.back(), this->GetLoadDescription());
|
SlObject(&edge, this->GetLoadDescription());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue