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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.3.0
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL

      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&.

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

              Created:
              Updated:
              Resolved: