From c647b19e9158b6b06ee5288017558bfc787a783e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Wed, 3 Apr 2019 14:51:59 -0400 Subject: [PATCH] infohash: make some methods constexpr, noexcept --- include/opendht/infohash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index e6be13b2..c6952970 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -65,7 +65,7 @@ public: typedef typename T::iterator iterator; typedef typename T::const_iterator const_iterator; - Hash () { + Hash () noexcept { data_.fill(0); } Hash (const uint8_t* h, size_t data_len) { @@ -85,7 +85,7 @@ public: msgpack_unpack(o); } - size_t size() const { return data_.size(); } + constexpr size_t size() const noexcept { return data_.size(); } const uint8_t* data() const { return data_.data(); } uint8_t* data() { return data_.data(); } iterator begin() { return data_.begin(); } -- GitLab