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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • ALL
    • QE 2025-07-21
    • 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 without an & causes a copy.
      /data/mci/385589e166d92c817192496324d07f27/bazel_cache/54fd804a20c0ed84a5084b07abc2f8fa/execroot/_main/src/mongo/db/query/query_settings/query_settings_manager.cpp:215: AUTO_CAUSES_COPY 175304 Using the "auto" keyword without an "&" causes the copy of an object of type "mongo::query_settings::QueryShapeConfigurationsMap".
      /data/mci/385589e166d92c817192496324d07f27/bazel_cache/54fd804a20c0ed84a5084b07abc2f8fa/execroot/_main/src/mongo/db/query/query_settings/query_settings_manager.cpp:215: AUTO_CAUSES_COPY 175304 The variable "queryShapeHashToQueryShapeConfigurationsMap" has a non-"const" type, however its value is never changed.

            Assignee:
            Catalin Sumanaru
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: