summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Nelson <lamont.nelson@mongodb.com>2020-02-27 17:23:21 -0500
committerLamont Nelson <lamont.nelson@mongodb.com>2020-02-27 17:23:21 -0500
commit6522d3a951543a3d572406713f4f21f15122e0bf (patch)
treefff3e2abe9b331ffc34a92a0a1c878003cf6c492
parent4f71bda6928b925c9136f38ec672a74c752bcc79 (diff)
downloadmongo-6522d3a951543a3d572406713f4f21f15122e0bf.tar.gz
Revert "remove refs"
This reverts commit 0514dd5e06fade374c872b17cd5a5322fc952a30.
-rw-r--r--src/mongo/client/sdam/server_selector.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/client/sdam/server_selector.h b/src/mongo/client/sdam/server_selector.h
index 1a332bcb5c2..345319ac7e4 100644
--- a/src/mongo/client/sdam/server_selector.h
+++ b/src/mongo/client/sdam/server_selector.h
@@ -106,7 +106,7 @@ private:
invariant(topologyDescription->getPrimary());
const auto& primaryDescription = *topologyDescription->getPrimary();
- const auto primaryLastWriteDate = primaryDescription->getLastWriteDate()
+ const auto& primaryLastWriteDate = primaryDescription->getLastWriteDate()
? *primaryDescription->getLastWriteDate()
: Date_t::min();
@@ -123,7 +123,7 @@ private:
if (s->getType() != ServerType::kRSSecondary)
continue;
- const auto sLastWriteDate =
+ const auto& sLastWriteDate =
s->getLastWriteDate() ? *s->getLastWriteDate() : Date_t::min();
if (sLastWriteDate > maxLastWriteDate) {