CComponentsForm: return id only if parameter is not 0

This commit is contained in:
2013-06-12 22:22:50 +02:00
parent 2e42455e25
commit 2af1c5d8b2

View File

@@ -154,9 +154,11 @@ void CComponentsForm::addCCItem(CComponentsItem* cc_Item)
int CComponentsForm::getCCItemId(CComponentsItem* cc_Item) int CComponentsForm::getCCItemId(CComponentsItem* cc_Item)
{ {
for (size_t i= 0; i< v_cc_items.size(); i++) if (cc_Item){
if (v_cc_items[i] == cc_Item) for (size_t i= 0; i< v_cc_items.size(); i++)
return i; if (v_cc_items[i] == cc_Item)
return i;
}
return -1; return -1;
} }