Coverity analysis defect 174857: Use of auto that causes a copy

XMLWordPrintableJSON

    • Server Security
    • Minor Change
    • ALL
    • Server Security 2025-07-20
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Use of auto that causes a copy

      Unnecessary object copies can affect performance. Using the auto keyword leads to an object copy, even if it the variable is unused.
      /src/mongo/db/modules/enterprise/src/audit/audit_event.cpp:148: AUTO_CAUSES_COPY 174857 Using the "auto" keyword without an "&" causes the copy of an object of type "std::vector<mongo::HostAndPort, std::allocator<mongo::HostAndPort> >", even if that object is not read.

              Assignee:
              Chye Lin Chee
              Reporter:
              Coverity Collector User
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: