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?
This commit is contained in:
Charles Kerr 2025-04-06 21:02:04 -05:00 committed by GitHub
parent ac18decc56
commit 3c5c9c8e19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);