mirror of https://github.com/OpenRCT2/OpenRCT2.git
Make direction_reverse constexpr and pass arg by value
To make totally sure that the compiler understands it can fully compute the value at compile time when dealing with constant inputs, and to make totally sure there are no aliasing problems.
This commit is contained in:
parent
b77f1285a4
commit
3b9dd87caf
|
@ -144,7 +144,7 @@ typedef uint8_t Direction;
|
|||
* Given a direction, return the direction that points the other way,
|
||||
* on the same axis.
|
||||
*/
|
||||
inline Direction direction_reverse(const Direction& dir)
|
||||
constexpr Direction direction_reverse(Direction dir)
|
||||
{
|
||||
return dir ^ 2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue