mirror of
https://github.com/electron/electron.git
synced 2026-01-22 22:08:14 -05:00
perf: avoid redundant virtual method call in NativeWindowViews::SetEnabledInternal() (#46527)
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user