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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • 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.
      /src/mongo/db/query/search/search_index_command_testing_helper.h:295: AUTO_CAUSES_COPY 174856 Using the "auto" keyword without an "&" causes the copy of an object of type "_gnu_cxx::_alloc_traits<std::allocator<mongo::IndexDefinition>, mongo::IndexDefinition>::value_type".
      /src/mongo/db/query/search/search_index_command_testing_helper.h:295: AUTO_CAUSES_COPY 174856 The variable "indexDefinition" has a non-"const" type, however its value is never changed.

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

              Created:
              Updated:
              Resolved: