mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
[Analyzers][CPP] Turn on rule 26497 (#23119)
* Turn on warning 26497 This function function-name could be marked constexpr if compile-time evaluation is desired. * C++20 has constexpr swap * as constexpr is not only for compile time, make all functions that can be constexpr constexpr * constexpr functions are implicity inline
This commit is contained in:
@@ -115,12 +115,12 @@ namespace
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isWin(int key)
|
||||
constexpr bool isWin(int key)
|
||||
{
|
||||
return key == VK_LWIN || key == VK_RWIN;
|
||||
}
|
||||
|
||||
bool isKeyDown(LowlevelKeyboardEvent event)
|
||||
constexpr bool isKeyDown(LowlevelKeyboardEvent event)
|
||||
{
|
||||
return event.wParam == WM_KEYDOWN || event.wParam == WM_SYSKEYDOWN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user