mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: replace C-style array-pointer methods with the appropriate C++ methods
This commit is contained in:
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…
Reference in New Issue