From f357fcc6794b44b5ca503623ded4350598726b07 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Feb 2016 00:10:47 +0100 Subject: [PATCH] Remove unnecessary checks in the window ID management code Remove asserts from the functions which are called only once and for which the caller already performs exactly the same check before calling them. --- src/common/windowid.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/common/windowid.cpp b/src/common/windowid.cpp index 025132acd6..20a0efbe20 100644 --- a/src/common/windowid.cpp +++ b/src/common/windowid.cpp @@ -87,9 +87,6 @@ void UnreserveIdRefCount(wxWindowID winid) // Get the usage count of an id int GetIdRefCount(wxWindowID winid) { - wxCHECK_MSG(winid >= wxID_AUTO_LOWEST && winid <= wxID_AUTO_HIGHEST, 0, - wxT("invalid id range")); - winid -= wxID_AUTO_LOWEST; int refCount = gs_autoIdsRefCount[winid]; if (refCount == ID_COUNTTOOLARGE) @@ -100,9 +97,6 @@ int GetIdRefCount(wxWindowID winid) // Increase the count for an id void IncIdRefCount(wxWindowID winid) { - wxCHECK_RET(winid >= wxID_AUTO_LOWEST && winid <= wxID_AUTO_HIGHEST, - wxT("invalid id range")); - winid -= wxID_AUTO_LOWEST; wxCHECK_RET(gs_autoIdsRefCount[winid] != ID_FREE, wxT("id should first be reserved")); @@ -133,9 +127,6 @@ void IncIdRefCount(wxWindowID winid) // Decrease the count for an id void DecIdRefCount(wxWindowID winid) { - wxCHECK_RET(winid >= wxID_AUTO_LOWEST && winid <= wxID_AUTO_HIGHEST, - wxT("invalid id range")); - winid -= wxID_AUTO_LOWEST; wxCHECK_RET(gs_autoIdsRefCount[winid] != ID_FREE, wxT("id count already 0"));