Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-6964

Extract function needs to be smarter for parameter arguments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 2.5.0-beta, Qt Creator 2.8.0-beta
    • C/C++/Obj-C++ Support
    • None

      Consider the following code:

      QString a;
      a = "a";

      Extracting the second line, creates a function:
      void foo(QString a) {
      a = "a";
      }

      which due to the value passing only modifies a local variabling. Passing by reference or pointer would be a better choice.

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

            erikv Erik Verbruggen
            dt Daniel Teske
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes