summaryrefslogtreecommitdiff
path: root/src/pathfinder
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-06-13 05:15:36 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-07-09 21:36:09 +0200
commit49b66ea504fafe9b942b35a97c369c4afa054f41 (patch)
tree55441ecb7e10afa37d003239abf7ec5aad97a71f /src/pathfinder
parenta543a4b7bb0d869800591ec1504b3934b68ecd8f (diff)
downloadopenttd-49b66ea504fafe9b942b35a97c369c4afa054f41.tar.xz
Codechange: Remove FOR_EACH_SET_TRACK
Diffstat (limited to 'src/pathfinder')
-rw-r--r--src/pathfinder/follow_track.hpp3
-rw-r--r--src/pathfinder/npf/npf.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp
index 7e5e0e39b..a9a51da68 100644
--- a/src/pathfinder/follow_track.hpp
+++ b/src/pathfinder/follow_track.hpp
@@ -184,8 +184,7 @@ struct CFollowTrackT
/* Mask already reserved trackdirs. */
m_new_td_bits &= ~TrackBitsToTrackdirBits(reserved);
/* Mask out all trackdirs that conflict with the reservation. */
- Track t;
- FOR_EACH_SET_TRACK(t, TrackdirBitsToTrackBits(m_new_td_bits)) {
+ for (Track t : SetTrackBitIterator(TrackdirBitsToTrackBits(m_new_td_bits))) {
if (TracksOverlap(reserved | TrackToTrackBits(t))) m_new_td_bits &= ~TrackToTrackdirBits(t);
}
if (m_new_td_bits == TRACKDIR_BIT_NONE) {
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 588718185..24803fb31 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -954,8 +954,7 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current)
TrackBits reserved = GetReservedTrackbits(dst_tile);
trackdirbits &= ~TrackBitsToTrackdirBits(reserved);
- Track t;
- FOR_EACH_SET_TRACK(t, TrackdirBitsToTrackBits(trackdirbits)) {
+ for (Track t : SetTrackBitIterator(TrackdirBitsToTrackBits(trackdirbits))) {
if (TracksOverlap(reserved | TrackToTrackBits(t))) trackdirbits &= ~TrackToTrackdirBits(t);
}
}