Replace FindFirstBit/FindFirstBit64 with a single template function

This commit is contained in:
Jonathan G Rennison
2021-11-01 23:00:44 +00:00
parent d585ce75dd
commit 1e0bea5b8d
8 changed files with 41 additions and 37 deletions

View File

@@ -220,7 +220,7 @@ void InitRailTypes()
RailTypes compatible = _railtypes[rt].all_compatible_railtypes;
RailTypes to_check = compatible;
while (to_check) {
RailType i = (RailType)FindFirstBit64(to_check);
RailType i = (RailType)FindFirstBit(to_check);
to_check = KillFirstBit(to_check);
RailTypes new_types = _railtypes[i].compatible_railtypes & (~compatible);
to_check |= new_types;
@@ -228,7 +228,7 @@ void InitRailTypes()
}
RailTypes to_update = compatible;
while (to_update) {
RailType i = (RailType)FindFirstBit64(to_update);
RailType i = (RailType)FindFirstBit(to_update);
to_update = KillFirstBit(to_update);
_railtypes[i].all_compatible_railtypes = compatible;
}