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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • ALL
    • CAR Team 2025-08-04
    • 1
    • None
    • 3
    • TBD
    • 🟥 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/638368f039cd5939b9e068441d1628dd/bazel_cache/e34b8011bf1e617092c6b7f9cc19781c/execroot/_main/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp:847: AUTO_CAUSES_COPY 175533 Using the "auto" keyword without an "&" causes the copy of an object of type "std::string".
      /data/mci/638368f039cd5939b9e068441d1628dd/bazel_cache/e34b8011bf1e617092c6b7f9cc19781c/execroot/_main/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp:847: AUTO_CAUSES_COPY 175533 The variable "shardName" has a non-"const" type, however its value is never changed.

            Assignee:
            Robert Sander
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: