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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • 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/s/resharding/resharding_oplog_fetcher.cpp:627: AUTO_CAUSES_COPY 174862 This lambda has an unspecified return type. This implies "auto" and causes the copy of an object of type "mongo::ReshardingDonorOplogId".
      /data/mci/22bd5cb6273c9c571686198c9f6023af/bazel_cache/3d8c86e2cd3c28a487a62d019e05fed8/execroot/_main/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp:627: AUTO_CAUSES_COPY 174862 This return statement creates a copy.

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

              Created:
              Updated: