Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-703

QGraphicsItemAnimation optimization

    XMLWordPrintable

Details

    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));
        }

      /*!

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            rve Anders Bakken
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes