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

master
Rubidium 2 months ago committed by rubidium42
parent 2114888485
commit 8986fb0385

@ -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.

Loading…
Cancel
Save