From 3c5c9c8e1925c324c5d37204db15bea8f71dfee0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 6 Apr 2025 21:02:04 -0500 Subject: [PATCH] perf: avoid redundant virtual method call in `NativeWindowViews::SetEnabledInternal()` (#46508) perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal() Why waste time make lot call when few call do trick? --- shell/browser/native_window_views.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 7e72ea998619..130277a66d72 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -623,11 +623,8 @@ bool NativeWindowViews::ShouldBeEnabled() const { } void NativeWindowViews::SetEnabledInternal(bool enable) { - if (enable && IsEnabled()) { + if (enable == IsEnabled()) return; - } else if (!enable && !IsEnabled()) { - return; - } #if BUILDFLAG(IS_WIN) ::EnableWindow(GetAcceleratedWidget(), enable);