Skip to content

Commit

Permalink
Simplify slightly Map::loadMap method.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Sep 24, 2024
1 parent 527ae83 commit f65600f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,8 @@ std::list<Tank> Map::loadMap(std::iostream& stream)
for (std::size_t x = 0; x < mapDimension_; ++x)
{
stream >> std::noskipws >> sign;

while (!isTileSign(sign))
{
while ((sign != EOF) && (!isTileSign(sign)))
stream >> std::noskipws >> sign;
if (sign == EOF)
break;
}

createTile(sign, tanks, {x, y});
}
Expand Down

0 comments on commit f65600f

Please sign in to comment.