Codechange: replace C-style array-pointer methods with the appropriate C++ methods

This commit is contained in:
Rubidium 2024-04-07 22:38:36 +02:00 committed by rubidium42
parent 2114888485
commit 8986fb0385
1 changed files with 2 additions and 2 deletions

View File

@ -130,8 +130,8 @@ struct AirportSpec {
/** Get the index of this spec. */
uint8_t GetIndex() const
{
assert(this >= specs && this < endof(specs));
return (uint8_t)(this - specs);
assert(this >= std::begin(specs) && this < std::end(specs));
return static_cast<uint8_t>(std::distance(std::cbegin(specs), this));
}
static const AirportSpec dummy; ///< The dummy airport.