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

XMLWordPrintableJSON

    • 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/6140986752f315ae1d2c1d7ffa1ce13a/bazel_cache/1e034c4de3ae6337dc7b387a79ef43e8/execroot/_main/src/mongo/db/pipeline/search/search_helper.cpp:630: AUTO_CAUSES_COPY 174950 Using the "auto" keyword without an "&" causes the copy of an object of type "std::pair<mongo::NamespaceString, std::vector<mongo::BSONObj, std::allocator<mongo::BSONObj> > >".
      /data/mci/6140986752f315ae1d2c1d7ffa1ce13a/bazel_cache/1e034c4de3ae6337dc7b387a79ef43e8/execroot/_main/src/mongo/db/pipeline/search/search_helper.cpp:630: AUTO_CAUSES_COPY 174950 The variable "expCtxView" 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: