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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2025-07-21, CAR Team 2025-08-04, CAR Team 2025-08-18
    • 1
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      Use of auto that causes a copy

      Unnecessary object copies can affect performance. Using the auto keyword without an & causes a copy.
      /data/mci/6140986752f315ae1d2c1d7ffa1ce13a/bazel_cache/1e034c4de3ae6337dc7b387a79ef43e8/execroot/_main/src/mongo/db/s/create_collection_coordinator.cpp:1785: AUTO_CAUSES_COPY 174971 This lambda has an unspecified return type. This implies "auto" and causes the copy of an object of type "mongo::ShardId".
      /data/mci/6140986752f315ae1d2c1d7ffa1ce13a/bazel_cache/1e034c4de3ae6337dc7b387a79ef43e8/execroot/_main/src/mongo/db/s/create_collection_coordinator.cpp:1794: AUTO_CAUSES_COPY 174971 This return statement creates a copy.

            Assignee:
            Silvia Surroca
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: