mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 17:32:45 +01:00
Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
This commit is contained in:
committed by
Peter Nelson
parent
1f18894408
commit
3be0166801
@@ -24,7 +24,7 @@ std::vector<TileIndex> _animated_tiles;
|
||||
*/
|
||||
void DeleteAnimatedTile(TileIndex tile)
|
||||
{
|
||||
auto to_remove = std::find(_animated_tiles.begin(), _animated_tiles.end(), tile);
|
||||
auto to_remove = std::ranges::find(_animated_tiles, tile);
|
||||
if (to_remove != _animated_tiles.end()) {
|
||||
/* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */
|
||||
_animated_tiles.erase(to_remove);
|
||||
|
||||
Reference in New Issue
Block a user