micro-optimize FOO-=$$BAR for empty FOO

there is no point in iterating BAR if FOO is (or became) empty.

Change-Id: I86c89bf0ad726a5ab7ead990a27ef7cc32caebbf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-12-16 13:34:02 +01:00
parent d88ff29c57
commit 33c33f6475

View File

@ -396,9 +396,12 @@ void ProStringList::removeAll(const char *str)
void ProStringList::removeEach(const ProStringList &value)
{
for (const ProString &str : value)
for (const ProString &str : value) {
if (isEmpty())
break;
if (!str.isEmpty())
removeAll(str);
}
}
void ProStringList::removeEmpty()