summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/compare_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/update/compare_node.cpp')
-rw-r--r--src/mongo/db/update/compare_node.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/update/compare_node.cpp b/src/mongo/db/update/compare_node.cpp
index d42d8be621f..c41dbe886b1 100644
--- a/src/mongo/db/update/compare_node.cpp
+++ b/src/mongo/db/update/compare_node.cpp
@@ -46,13 +46,13 @@ void CompareNode::setCollator(const CollatorInterface* collator) {
_collator = collator;
}
-void CompareNode::updateExistingElement(mutablebson::Element* element, bool* noop) const {
+bool CompareNode::updateExistingElement(mutablebson::Element* element) const {
const auto compareVal = element->compareWithBSONElement(_val, _collator, false);
if ((compareVal == 0) || ((_mode == CompareMode::kMax) ? (compareVal > 0) : (compareVal < 0))) {
- *noop = true;
+ return false;
} else {
- *noop = false;
invariantOK(element->setValueBSONElement(_val));
+ return true;
}
}