aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-12-12 13:47:11 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-12-12 13:47:11 +0000
commit81487d4843b65c66f2f14a3346f3b6b51b85e245 (patch)
treef5fd47779d893464b0938eac46a2d12afd9b1daf /vespalib
parent3f54d4088502406eda15288bde29a16f6c810751 (diff)
Unify on using reference where possible.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/doom.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/util/doom.h14
2 files changed, 8 insertions, 8 deletions
diff --git a/vespalib/src/vespa/vespalib/util/doom.cpp b/vespalib/src/vespa/vespalib/util/doom.cpp
index 01ad3aa4e97..227d43ee4c4 100644
--- a/vespalib/src/vespa/vespalib/util/doom.cpp
+++ b/vespalib/src/vespa/vespalib/util/doom.cpp
@@ -5,7 +5,7 @@
namespace vespalib {
Doom::Doom(const Clock &clock, steady_time softDoom,
- steady_time hardDoom, bool explicitSoftDoom)
+ steady_time hardDoom, bool explicitSoftDoom) noexcept
: _clock(clock),
_softDoom(softDoom),
_hardDoom(hardDoom),
diff --git a/vespalib/src/vespa/vespalib/util/doom.h b/vespalib/src/vespa/vespalib/util/doom.h
index cbac7e2cfbd..a175bbd20df 100644
--- a/vespalib/src/vespa/vespalib/util/doom.h
+++ b/vespalib/src/vespa/vespalib/util/doom.h
@@ -8,17 +8,17 @@ namespace vespalib {
class Doom {
public:
- Doom(const Clock &clock, steady_time doom)
+ Doom(const Clock &clock, steady_time doom) noexcept
: Doom(clock, doom, doom, false)
{}
Doom(const Clock &clock, steady_time softDoom,
- steady_time hardDoom, bool explicitSoftDoom);
+ steady_time hardDoom, bool explicitSoftDoom) noexcept;
- bool soft_doom() const { return (_clock.getTimeNS() > _softDoom); }
- bool hard_doom() const { return (_clock.getTimeNS() > _hardDoom); }
- duration soft_left() const { return _softDoom - _clock.getTimeNS(); }
- duration hard_left() const { return _hardDoom - _clock.getTimeNS(); }
- bool isExplicitSoftDoom() const { return _isExplicitSoftDoom; }
+ bool soft_doom() const noexcept { return (_clock.getTimeNS() > _softDoom); }
+ bool hard_doom() const noexcept { return (_clock.getTimeNS() > _hardDoom); }
+ duration soft_left() const noexcept { return _softDoom - _clock.getTimeNS(); }
+ duration hard_left() const noexcept { return _hardDoom - _clock.getTimeNS(); }
+ bool isExplicitSoftDoom() const noexcept { return _isExplicitSoftDoom; }
private:
const Clock &_clock;
steady_time _softDoom;