From ac0c10c1704fd4bdc33848762e52270a68e31743 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 Jan 2022 14:06:22 +0530 Subject: [PATCH] Simplify if condition --- glfw/cocoa_window.m | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 13e8d1f9e..f9a27e60c 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1598,16 +1598,7 @@ - (void) removeGLFWWindow - (BOOL)validateMenuItem:(NSMenuItem *)item { if (item.action == @selector(performMiniaturize:)) return YES; if (item.action == @selector(toggleSecureInput:)) { - SecureKeyboardEntryController *controller = [SecureKeyboardEntryController sharedInstance]; - if (controller.isEnabled) { - if (controller.isDesired) { - item.state = NSControlStateValueOn; - } else { - item.state = NSControlStateValueMixed; - } - } else { - item.state = controller.isDesired ? NSControlStateValueOn : NSControlStateValueOff; - } + item.state = [SecureKeyboardEntryController sharedInstance].isDesired ? NSControlStateValueOn : NSControlStateValueOff; return YES; } return [super validateMenuItem:item];