From e7b216ba6834b169b8bb257632e6eb02266ec54d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Apr 2022 16:24:21 +0530 Subject: [PATCH] DRYer --- kitty/mouse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kitty/mouse.c b/kitty/mouse.c index f63171529..84355f9f9 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -67,13 +67,11 @@ static char mouse_event_buf[64]; static int encode_mouse_event_impl(const MousePosition *mpos, int mouse_tracking_protocol, int button, MouseAction action, int mods) { - unsigned int cb = 0; + unsigned int cb = encode_button(button); if (action == MOVE) { - cb = encode_button(button); if (cb == UINT_MAX) cb = 3; cb += 32; } else { - cb = encode_button(button); if (cb == UINT_MAX) return 0; } if (action == DRAG || action == MOVE) cb |= MOTION_INDICATOR;