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

QVector append: unnecessary performance penalty

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.1
    • None

    Description

      My attention was attracted by the fact that QVector::append
      causes the copied object's copy ctor to called twice (unlike when using std::vector)

      And indeed, inside:

      void QVector<T>::append(const T &t)

      the line:

      const T copy(t);

      seems totally unnessary. I guess:

      const T& copy(t);

      was the intention.

      Anyway, I rebuilt Qt with this small change and my big application is running fine.

      Am I missing the obvious?

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            jirauser26727 user-04d21 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes