From dca84c823c78d8f686d23a8a8efa189d17cc7d0c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 May 2018 02:10:34 +0200 Subject: [PATCH] Optimize away an unnecessary extra wxAuiNotebook::DoSizing() call There is no need to call DoSizing() again if it has just been called from UpdateTabCtrlHeight(). --- src/aui/auibook.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 0a37a469ba..2bc8d0587a 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -1973,8 +1973,11 @@ bool wxAuiNotebook::InsertPage(size_t page_idx, else active_tabctrl->InsertPage(page, info, page_idx); - UpdateTabCtrlHeight(); - DoSizing(); + // Note that we don't need to call DoSizing() if the height has changed, as + // it's already called from UpdateTabCtrlHeight() itself in this case. + if ( !UpdateTabCtrlHeight() ) + DoSizing(); + active_tabctrl->DoShowHide(); // adjust selected index