Coverity analysis defect 174805: 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 Integration
    • Fully Compatible
    • 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.
      /data/mci/22bd5cb6273c9c571686198c9f6023af/bazel_cache/3d8c86e2cd3c28a487a62d019e05fed8/execroot/main/src/mongo/db/pipeline/document_source_hybrid_scoring_util.cpp:234: AUTO_CAUSES_COPY 174805 Using the "auto" keyword without an "&" causes the copy of an object of type "std::_Rb_tree<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Identity<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value_type".
      /data/mci/22bd5cb6273c9c571686198c9f6023af/bazel_cache/3d8c86e2cd3c28a487a62d019e05fed8/execroot/_main/src/mongo/db/pipeline/document_source_hybrid_scoring_util.cpp:234: AUTO_CAUSES_COPY 174805 The variable "fieldName" 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:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: