diff options
author | Benety Goh <benety@mongodb.com> | 2021-05-03 09:16:57 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-03 13:54:51 +0000 |
commit | 7d746afd02264f30e766caff7183bd2a8961c27d (patch) | |
tree | ad346386e2f978ed5156c7dd40e46385439d73b3 | |
parent | f96326be159b4dda099fcf445ededb6ccaf95f6c (diff) | |
download | mongo-7d746afd02264f30e766caff7183bd2a8961c27d.tar.gz |
SERVER-55977 fix coverity analysis defect 118057: unchecked return value
-rw-r--r-- | src/mongo/db/timeseries/bucket_catalog.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/timeseries/bucket_catalog.cpp b/src/mongo/db/timeseries/bucket_catalog.cpp index 2aebb3f9af2..6daf97c95e5 100644 --- a/src/mongo/db/timeseries/bucket_catalog.cpp +++ b/src/mongo/db/timeseries/bucket_catalog.cpp @@ -39,6 +39,7 @@ #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/operation_context.h" #include "mongo/db/views/view_catalog.h" +#include "mongo/platform/compiler.h" #include "mongo/stdx/thread.h" #include "mongo/util/fail_point.h" @@ -1235,7 +1236,8 @@ BSONObj BucketCatalog::MinMax::minUpdates() { invariant(_min.type() == Type::kObject); BSONObjBuilder builder; - _appendUpdates(&builder, GetMin()); + // Return constructed document even if empty. + MONGO_COMPILER_VARIABLE_UNUSED auto appended = _appendUpdates(&builder, GetMin()); return builder.obj(); } @@ -1243,7 +1245,8 @@ BSONObj BucketCatalog::MinMax::maxUpdates() { invariant(_max.type() == Type::kObject); BSONObjBuilder builder; - _appendUpdates(&builder, GetMax()); + // Return constructed document even if empty. + MONGO_COMPILER_VARIABLE_UNUSED auto appended = _appendUpdates(&builder, GetMax()); return builder.obj(); } |