Simplify (and inline) is_shortcut_mod()

Masking was unnecessary (im->sdl_shortcut_mods is implicitly masked).

PR #5322 <https://github.com/Genymobile/scrcpy/pull/5322>
This commit is contained in:
Romain Vimont 2024-09-25 22:39:22 +02:00
parent a6f74d72f5
commit 65fc53eace

View File

@ -33,10 +33,10 @@ to_sdl_mod(uint8_t shortcut_mod) {
return sdl_mod;
}
static bool
static inline bool
is_shortcut_mod(struct sc_input_manager *im, uint16_t sdl_mod) {
// keep only the relevant modifier keys
sdl_mod &= SC_SDL_SHORTCUT_MODS_MASK;
// im->sdl_shortcut_mods is within the mask
assert(!(im->sdl_shortcut_mods & ~SC_SDL_SHORTCUT_MODS_MASK));
// at least one shortcut mod pressed?
return sdl_mod & im->sdl_shortcut_mods;