Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6908

Do not pass strings by value, pass by const ref (&)

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Trivial - P5 Trivial - P5
    • 2.3.0
    • None
    • Internal Code
    • None
    • Fully Compatible
    • ALL

    Description

      We're pretty good about passing const references to strings instead of passing them by value, avoiding a string copy that serves no purpose. But we're not perfect. In code where the called routine doesn't change its local copy of string arguments, we should always use const&.

      Attachments

        Activity

          People

            tad Tad Marshall
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: