From 8b525fd1be14965d281cffbcd730025824c5e682 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 15 Feb 2015 00:01:47 +0000 Subject: [PATCH] Remove useless check for NULL in wxFindWindowRecursively(). This is an internal function which is only ever called with non-NULL window. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 5640c43103..dbaa328f10 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1912,23 +1912,20 @@ wxWindow *wxFindWindowRecursively(const wxWindow *parent, long id, wxFindWindowCmp cmp) { - if ( parent ) - { - // see if this is the one we're looking for - if ( (*cmp)(parent, label, id) ) - return (wxWindow *)parent; + // see if this is the one we're looking for + if ( (*cmp)(parent, label, id) ) + return (wxWindow *)parent; - // It wasn't, so check all its children - for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - // recursively check each child - wxWindow *win = (wxWindow *)node->GetData(); - wxWindow *retwin = wxFindWindowRecursively(win, label, id, cmp); - if (retwin) - return retwin; - } + // It wasn't, so check all its children + for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst(); + node; + node = node->GetNext() ) + { + // recursively check each child + wxWindow *win = (wxWindow *)node->GetData(); + wxWindow *retwin = wxFindWindowRecursively(win, label, id, cmp); + if (retwin) + return retwin; } // Not found