From ec36eb990bc2a95b7f16ce5ebb74a14e97e134c1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Mar 2020 22:32:05 +0100 Subject: [PATCH] Avoid code duplication in wxAuiToolBar::DeleteTool() Delegate to the existing DeleteByIndex() instead of repeating its code in DeleteTool(). No real changes, this is just a refactoring. --- src/aui/auibar.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 4b6f3379c0..61a3780481 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -1165,15 +1165,7 @@ void wxAuiToolBar::Clear() bool wxAuiToolBar::DeleteTool(int tool_id) { - int idx = GetToolIndex(tool_id); - if (idx >= 0 && idx < (int)m_items.GetCount()) - { - m_items.RemoveAt(idx); - Realize(); - return true; - } - - return false; + return DeleteByIndex(GetToolIndex(tool_id)); } bool wxAuiToolBar::DeleteByIndex(int idx)