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:
parent
d88ff29c57
commit
33c33f6475
@ -396,9 +396,12 @@ void ProStringList::removeAll(const char *str)
|
|||||||
|
|
||||||
void ProStringList::removeEach(const ProStringList &value)
|
void ProStringList::removeEach(const ProStringList &value)
|
||||||
{
|
{
|
||||||
for (const ProString &str : value)
|
for (const ProString &str : value) {
|
||||||
|
if (isEmpty())
|
||||||
|
break;
|
||||||
if (!str.isEmpty())
|
if (!str.isEmpty())
|
||||||
removeAll(str);
|
removeAll(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProStringList::removeEmpty()
|
void ProStringList::removeEmpty()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user