diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-12-15 00:22:04 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-12-15 00:29:30 +0100 |
commit | 79240eab1ee4abb2882a40c7ac18e4915b4dc820 (patch) | |
tree | 98abb3c8ccf490efa459ed29fe7f28699c8d9928 /src/newgrf.cpp | |
parent | cc1679e3171bf6982164c4072a773fdd687ea885 (diff) | |
download | openttd-79240eab1ee4abb2882a40c7ac18e4915b4dc820.tar.xz |
Codechange: Make use of the improved C++17 emplace_back function.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 4abbcb3b7..21dc9ffb4 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1916,8 +1916,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte tmp_layout.clear(); for (;;) { /* no relative bounding box support */ - /*C++17: DrawTileSeqStruct &dtss = */ tmp_layout.emplace_back(); - DrawTileSeqStruct &dtss = tmp_layout.back(); + DrawTileSeqStruct &dtss = tmp_layout.emplace_back(); MemSetT(&dtss, 0); dtss.delta_x = buf->ReadByte(); @@ -5020,8 +5019,7 @@ static void NewSpriteGroup(ByteReader *buf) /* Loop through the var adjusts. Unfortunately we don't know how many we have * from the outset, so we shall have to keep reallocing. */ do { - /*C++17: DeterministicSpriteGroupAdjust &adjust = */ adjusts.emplace_back(); - DeterministicSpriteGroupAdjust &adjust = adjusts.back(); + DeterministicSpriteGroupAdjust &adjust = adjusts.emplace_back(); /* The first var adjust doesn't have an operation specified, so we set it to add. */ adjust.operation = adjusts.size() == 1 ? DSGA_OP_ADD : (DeterministicSpriteGroupAdjustOperation)buf->ReadByte(); |