Codechange: replace for loops with endof with range-based for loops
This commit is contained in:
@@ -136,8 +136,6 @@ static std::tuple<CommandCost, TileIndex> TerraformTileHeight(TerraformerState *
|
||||
|
||||
/* Recurse to neighboured corners if height difference is larger than 1 */
|
||||
{
|
||||
const TileIndexDiffC *ttm;
|
||||
|
||||
TileIndex orig_tile = tile;
|
||||
static const TileIndexDiffC _terraform_tilepos[] = {
|
||||
{ 1, 0}, // move to tile in SE
|
||||
@@ -146,8 +144,8 @@ static std::tuple<CommandCost, TileIndex> TerraformTileHeight(TerraformerState *
|
||||
{ 0, -2} // undo last move, and move to tile in NE
|
||||
};
|
||||
|
||||
for (ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) {
|
||||
tile += ToTileIndexDiff(*ttm);
|
||||
for (const auto &ttm : _terraform_tilepos) {
|
||||
tile += ToTileIndexDiff(ttm);
|
||||
|
||||
if (tile >= Map::Size()) continue;
|
||||
/* Make sure we don't wrap around the map */
|
||||
|
||||
Reference in New Issue
Block a user