Details
-
Suggestion
-
Resolution: Out of scope
-
P4: Low
-
4.3.0
-
None
Description
QGraphicsItemAnimationPrivate::insertUniquePair will sort the entire list for every insert even though it already has searched the list. It could be optimized like this.
@@ -141,15 +142,16 @@ void QGraphicsItemAnimationPrivate::inse
return;
}
- Pair pair(step, value);
- - QList<Pair>::iterator result = qBinaryFind(binList->begin(), binList->end(), pair);
- if (result != binList->end())
- result->value = value;
- else {
- *binList << pair;
- qSort(binList->begin(), binList->end());
+ for (QList<Pair>::iterator it = binList->begin(); it != binList->end(); ++it)Unknown macro: {+ if (it->step == step) { + it->value = value; + return; + } else if (it->step > step) { + binList->insert(it, Pair(step, value)); + return; }+ }+ binList->append(Pair(step, value));
}
/*!