summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2017-02-04 12:28:54 -0500
committerMisha Tyulenev <misha@mongodb.com>2017-02-04 12:28:54 -0500
commit955fe032a1cb83f4abe9932d59a6c02c473dc047 (patch)
tree939ded91d5d4f847419e715b2508c476f9a6642c /src
parentc5f52fb3265ef68ffe2741f88758082dda393a4b (diff)
downloadmongo-955fe032a1cb83f4abe9932d59a6c02c473dc047.tar.gz
SERVER-27917: fix pessimizing move and library dependency in logical_clock code
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/SConscript1
-rw-r--r--src/mongo/db/logical_clock_test.cpp6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 54fbb66b0d9..9c923b5d1b9 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -963,6 +963,7 @@ env.Library(
'logical_clock.cpp',
],
LIBDEPS=[
+ 'service_context',
'signed_logical_time',
],
)
diff --git a/src/mongo/db/logical_clock_test.cpp b/src/mongo/db/logical_clock_test.cpp
index cba0cc1faa6..729edaf650c 100644
--- a/src/mongo/db/logical_clock_test.cpp
+++ b/src/mongo/db/logical_clock_test.cpp
@@ -80,7 +80,7 @@ TEST_F(LogicalClockTestBase, roundtrip) {
LogicalClock logicalClock(&serviceContext, std::move(pTps), true);
logicalClock.initClusterTimeFromTrustedSource(time);
- auto storedTime(std::move(logicalClock.getClusterTime()));
+ auto storedTime(logicalClock.getClusterTime());
ASSERT_TRUE(storedTime.getTime() == time);
}
@@ -88,7 +88,7 @@ TEST_F(LogicalClockTestBase, roundtrip) {
// Verify the reserve ticks functionality.
TEST_F(LogicalClockTestBase, reserveTicks) {
auto t1 = getClock()->reserveTicks(1);
- auto t2(std::move(getClock()->getClusterTime()));
+ auto t2(getClock()->getClusterTime());
ASSERT_TRUE(t1 == t2.getTime());
auto t3 = getClock()->reserveTicks(1);
@@ -110,7 +110,7 @@ TEST_F(LogicalClockTestBase, advanceClusterTime) {
t1.addTicks(100);
SignedLogicalTime l1 = makeSignedLogicalTime(t1);
ASSERT_OK(getClock()->advanceClusterTime(l1));
- auto l2(std::move(getClock()->getClusterTime()));
+ auto l2(getClock()->getClusterTime());
ASSERT_TRUE(l1.getTime() == l2.getTime());
}