Changeset - r27338:d73c3ad6a29b
[Not reviewed]
master
0 1 0
Peter Nelson - 16 months ago 2023-05-12 19:51:54
peter1138@openttd.org
Codechange: Use iterator erase pattern.
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/station_gui.cpp
Show inline comments
 
@@ -2138,12 +2138,12 @@ static bool AddNearbyStation(TileIndex t
 
	TileArea *ctx = (TileArea *)user_data;
 

	
 
	/* First check if there were deleted stations here */
 
	for (uint i = 0; i < _deleted_stations_nearby.size(); i++) {
 
		auto ts = _deleted_stations_nearby.begin() + i;
 
		if (ts->tile == tile) {
 
			_stations_nearby_list.push_back(_deleted_stations_nearby[i].station);
 
			_deleted_stations_nearby.erase(ts);
 
			i--;
 
	for (auto it = _deleted_stations_nearby.begin(); it != _deleted_stations_nearby.end(); /* nothing */) {
 
		if (it->tile == tile) {
 
			_stations_nearby_list.push_back(it->station);
 
			it = _deleted_stations_nearby.erase(it);
 
		} else {
 
			++it;
 
		}
 
	}
 

	
0 comments (0 inline, 0 general)