diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-21 09:04:16 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-21 09:04:16 +0000 |
commit | bb85dda164515a47fb99173d0c642a52dd5283c7 (patch) | |
tree | b4789a3b18e6e7b835bc785edcbd785962c48f7b | |
parent | 490bdc5f1c510ca05ed709008fdd74226bba36d1 (diff) |
remove redundant if and inline simple method.
-rw-r--r-- | fastos/src/vespa/fastos/timestamp.cpp | 4 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/message.cpp | 5 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/message.h | 2 |
3 files changed, 2 insertions, 9 deletions
diff --git a/fastos/src/vespa/fastos/timestamp.cpp b/fastos/src/vespa/fastos/timestamp.cpp index ae6bef1e317..deceaee4c65 100644 --- a/fastos/src/vespa/fastos/timestamp.cpp +++ b/fastos/src/vespa/fastos/timestamp.cpp @@ -104,9 +104,7 @@ StopWatch::waitAtLeast(std::chrono::microseconds us, bool busyWait) { if (busyWait) { steady_clock::time_point deadline = steady_clock::now() + us; while (steady_clock::now() < deadline) { - if (busyWait) { - for (int i = 0; i < 1000; i++) { } - } + for (int i = 0; i < 1000; i++) { } } } else { std::this_thread::sleep_for(us); diff --git a/messagebus/src/vespa/messagebus/message.cpp b/messagebus/src/vespa/messagebus/message.cpp index af1d97334f6..c9fb03dd013 100644 --- a/messagebus/src/vespa/messagebus/message.cpp +++ b/messagebus/src/vespa/messagebus/message.cpp @@ -62,11 +62,6 @@ Message::setTimeReceivedNow() return *this; } -steady_clock::time_point -Message::getTimeReceived() const { - return _timeReceived; -} - milliseconds Message::getTimeRemainingNow() const { diff --git a/messagebus/src/vespa/messagebus/message.h b/messagebus/src/vespa/messagebus/message.h index 4021143a052..3069e45e6d8 100644 --- a/messagebus/src/vespa/messagebus/message.h +++ b/messagebus/src/vespa/messagebus/message.h @@ -37,7 +37,7 @@ public: * * @return The timestamp this was last seen. */ - time_point getTimeReceived() const; + time_point getTimeReceived() const { return _timeReceived; } /** * This is a convenience method to call {@link #setTimeReceived(uint64_t)} |