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:
parent
64c9afcf77
commit
ec34d8ee49
1 changed files with 1 additions and 4 deletions
|
@ -623,11 +623,8 @@ bool NativeWindowViews::ShouldBeEnabled() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowViews::SetEnabledInternal(bool enable) {
|
void NativeWindowViews::SetEnabledInternal(bool enable) {
|
||||||
if (enable && IsEnabled()) {
|
if (enable == IsEnabled())
|
||||||
return;
|
return;
|
||||||
} else if (!enable && !IsEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BUILDFLAG(IS_WIN)
|
#if BUILDFLAG(IS_WIN)
|
||||||
::EnableWindow(GetAcceleratedWidget(), enable);
|
::EnableWindow(GetAcceleratedWidget(), enable);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue