From 6d98766cd5cf93804fd14d1eb9765ab9e1357cb1 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 8 Jul 2024 16:18:06 +0200 Subject: [PATCH] Simplify boolean condition using XOR (A && !B) || (!A && B) <==> A ^ B PR #5076 --- app/src/input_manager.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/input_manager.c b/app/src/input_manager.c index 9da3a72799..96075f84dd 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -850,9 +850,7 @@ sc_input_manager_process_mouse_button(struct sc_input_manager *im, bool ctrl_pressed = keymod & KMOD_CTRL; bool shift_pressed = keymod & KMOD_SHIFT; if (event->button == SDL_BUTTON_LEFT && - ((down && !im->vfinger_down && - ((ctrl_pressed && !shift_pressed) || - (!ctrl_pressed && shift_pressed))) || + ((down && !im->vfinger_down && (ctrl_pressed ^ shift_pressed)) || (!down && im->vfinger_down))) { struct sc_point mouse = sc_screen_convert_window_to_frame_coords(im->screen, event->x,