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

QVector += QVector destroys pre-allocation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 4.8.0, 5.0.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      QVector<int> a, b; 
      a.reserve(1000); 
      b.append(1); 
      a += b;
      

      results in calling QVector::realloc(0, 1); essentially destroying the pre-allocation

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              biochimia João Abecasis
              Reporter:
              hjk hjk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes