AK: Change EnumBits has_flag() to check all flags in mask are present

Co-authored-by: Brian Gianforcaro <b.gianfo@gmail.com>
This commit is contained in:
Timothy 2021-07-14 21:57:11 +10:00 committed by Andreas Kling
parent 2df4d977e2
commit 03b76e4ba0
Notes: sideshowbarker 2024-07-18 08:56:55 +09:00

View File

@ -77,5 +77,5 @@
Prefix constexpr bool has_flag(Enum value, Enum mask) \
{ \
using Type = UnderlyingType<Enum>; \
return static_cast<Type>(value & mask) != 0; \
return static_cast<Type>(value & mask) == static_cast<Type>(mask); \
}