From d18ab050c4ce0536abd4bc9339a6dd1436172d7e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 6 Dec 2024 20:24:44 +0200 Subject: [PATCH] remove some range checks which are more likely to hide an underlying bug than they are to help Change-Id: I3bcac401d62f9baf27e72bacb6bb0a2315d1c081 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178000 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/control/valueset.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index a3dcb17d9a77..f1437e6aa0be 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -524,9 +524,7 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId ) if ( nPos == VALUESET_ITEM_NOTFOUND ) return; - if ( nPos < mItemList.size() ) { - mItemList.erase( mItemList.begin() + nPos ); - } + mItemList.erase( mItemList.begin() + nPos ); // reset variables if (mnHighItemId == nItemId || mnSelItemId == nItemId)