Skip to content

Commit 2455326

Browse files
committed
perf(tabbookmark): apply short circuit evaluation to HandleRightClick
1 parent 203adf4 commit 2455326

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/tabbookmark.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ int HandleRightClick(WPARAM wParam, PMOUSEHOOKSTRUCT pmouse) {
140140
return 0;
141141
}
142142

143-
bool is_on_one_tab = IsOnOneTab(top_container_view, pt);
144-
bool keep_tab = IsNeedKeep(top_container_view);
145-
146-
if (is_on_one_tab) {
147-
if (keep_tab) {
143+
if (IsOnOneTab(top_container_view, pt)) {
144+
if (IsNeedKeep(top_container_view)) {
148145
ExecuteCommand(IDC_NEW_TAB, hwnd);
149146
ExecuteCommand(IDC_WINDOW_CLOSE_OTHER_TABS, hwnd);
150147
} else {

0 commit comments

Comments
 (0)