>From 3e47e1577fc1d43a6367f3bb7c2d59c268399815 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin
Date: Sun, 30 Nov 2014 01:36:08 +0100 Subject: [PATCH 2/4] Don't count all MDI children, just check if there is more than one. Make the code in Skeleton::UponMenuOpen() marginally more efficient and slightly more clear and avoid pointer-to-integer coercion by just checking if more than one child exists instead of counting all of them. --- skeleton.cpp | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/skeleton.cpp b/skeleton.cpp index 995b0aa..b9036a9 100644 --- a/skeleton.cpp +++ b/skeleton.cpp @@ -821,22 +821,27 @@ void Skeleton::UponMenuOpen(wxMenuEvent& event) { event.Skip(); - int child_frame_count = 0; - wxWindowList const& wl = frame_->GetChildren(); - for(wxWindowList::const_iterator i = wl.begin(); i != wl.end(); ++i) - { - child_frame_count += !!dynamic_cast