Avoid modulo 0

Coverity pointed out that 'size' might be 0 (even if the 'find()' would
detect this). This commit fixes this and avoids entering 'find()' at
all.
This commit is contained in:
Mathias Gumz 2015-01-16 10:47:01 +01:00
parent ad8e6da8ef
commit e37cad714c

View file

@ -94,6 +94,10 @@ void Container::insertItem(Item item, int pos) {
void Container::moveItem(Item item, int movement) {
if (m_item_list.empty()) {
return;
}
int index = find(item);
const size_t size = m_item_list.size();