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();
|
||||
if (_errors != 0) throw std::exception();
|
||||
|
||||
this->compiled_strings.emplace_back(p.language);
|
||||
TranslationWriter writer(this->compiled_strings.back().lines);
|
||||
auto &strings = this->compiled_strings.emplace_back(p.language);
|
||||
TranslationWriter writer(strings.lines);
|
||||
writer.WriteLang(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -786,8 +786,8 @@ struct MpsMachine {
|
|||
this->tempo_ticks = this->current_tempo;
|
||||
|
||||
/* Always reset percussion channel to program 0 */
|
||||
this->target.blocks.push_back(MidiFile::DataBlock());
|
||||
AddMidiData(this->target.blocks.back(), MIDIST_PROGCHG + 9, 0x00);
|
||||
auto &data_block = this->target.blocks.emplace_back();
|
||||
AddMidiData(data_block, MIDIST_PROGCHG + 9, 0x00);
|
||||
|
||||
/* Technically should be an endless loop, but having
|
||||
* 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. */
|
||||
size_t size = SlGetStructListLength(UINT16_MAX);
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
bn->edges.emplace_back();
|
||||
SlObject(&bn->edges.back(), this->GetLoadDescription());
|
||||
auto &edge = bn->edges.emplace_back();
|
||||
SlObject(&edge, this->GetLoadDescription());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue