summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-05-03 09:16:57 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-03 13:54:51 +0000
commit7d746afd02264f30e766caff7183bd2a8961c27d (patch)
treead346386e2f978ed5156c7dd40e46385439d73b3
parentf96326be159b4dda099fcf445ededb6ccaf95f6c (diff)
downloadmongo-7d746afd02264f30e766caff7183bd2a8961c27d.tar.gz
SERVER-55977 fix coverity analysis defect 118057: unchecked return value
-rw-r--r--src/mongo/db/timeseries/bucket_catalog.cpp7
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();
}