perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal() (#46526)

perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal()

Why waste time make lot call when few call do trick?

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot]
2025-04-06 23:44:37 -05:00
committed by GitHub
parent b44892e27c
commit e76f986aa9

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