From 955fe032a1cb83f4abe9932d59a6c02c473dc047 Mon Sep 17 00:00:00 2001 From: Misha Tyulenev Date: Sat, 4 Feb 2017 12:28:54 -0500 Subject: SERVER-27917: fix pessimizing move and library dependency in logical_clock code --- src/mongo/db/SConscript | 1 + src/mongo/db/logical_clock_test.cpp | 6 +++--- 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()); } -- cgit v1.2.1