From fad9998f9d1a528555b68e36ffe8aafb6cece0ef Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 17 Jul 2015 09:55:24 -0700 Subject: [PATCH] Remove deprecated abstract_clock::elapsed --- src/beast/beast/chrono/abstract_clock.h | 6 ------ src/ripple/resource/impl/Logic.h | 10 +++++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/beast/beast/chrono/abstract_clock.h b/src/beast/beast/chrono/abstract_clock.h index 38d843711..352f389a1 100644 --- a/src/beast/beast/chrono/abstract_clock.h +++ b/src/beast/beast/chrono/abstract_clock.h @@ -69,12 +69,6 @@ public: /** Returns the current time. */ virtual time_point now() const = 0; - - /** Returning elapsed ticks since the epoch. */ - rep elapsed() const - { - return now().time_since_epoch().count(); - } }; //------------------------------------------------------------------------------ diff --git a/src/ripple/resource/impl/Logic.h b/src/ripple/resource/impl/Logic.h index 3d306bcd7..956421938 100644 --- a/src/ripple/resource/impl/Logic.h +++ b/src/ripple/resource/impl/Logic.h @@ -316,13 +316,13 @@ public: void importConsumers (std::string const& origin, Gossip const& gossip) { - clock_type::rep const elapsed (m_clock.elapsed()); + clock_type::rep const elapsed (m_clock.now().time_since_epoch().count()); { SharedState::Access state (m_state); std::pair result ( state->import_table.emplace (std::piecewise_construct, std::make_tuple(origin), // Key - std::make_tuple(m_clock.elapsed()))); // Import + std::make_tuple(m_clock.now().time_since_epoch().count()))); // Import if (result.second) { @@ -384,7 +384,7 @@ public: { SharedState::Access state (m_state); - clock_type::rep const elapsed (m_clock.elapsed()); + clock_type::rep const elapsed (m_clock.now().time_since_epoch().count()); for (auto iter (state->inactive.begin()); iter != state->inactive.end();) { @@ -466,7 +466,7 @@ public: break; } state->inactive.push_back (entry); - entry.whenExpires = m_clock.elapsed() + secondsUntilExpiration; + entry.whenExpires = m_clock.now().time_since_epoch().count() + secondsUntilExpiration; } } @@ -491,7 +491,7 @@ public: bool warn (Entry& entry, SharedState::Access& state) { bool notify (false); - clock_type::rep const elapsed (m_clock.elapsed()); + clock_type::rep const elapsed (m_clock.now().time_since_epoch().count()); if (entry.balance (m_clock.now()) >= warningThreshold && elapsed != entry.lastWarningTime) {