From 77e59818a36b6d360ea5dff10c264edd75013f91 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 27 Feb 2020 15:59:39 -0800 Subject: [PATCH] dead code removal --- node/Buf.hpp | 7 ------- node/Fingerprint.hpp | 9 +-------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/node/Buf.hpp b/node/Buf.hpp index ce55b889c..ba4caf055 100644 --- a/node/Buf.hpp +++ b/node/Buf.hpp @@ -706,13 +706,6 @@ public: template ZT_ALWAYS_INLINE const T &as(const unsigned int i = 0) const noexcept { return *reinterpret_cast(unsafeData + i); } - ZT_ALWAYS_INLINE bool operator==(const Buf &b2) const noexcept { return (memcmp(unsafeData,b2.unsafeData,ZT_BUF_MEM_SIZE) == 0); } - ZT_ALWAYS_INLINE bool operator!=(const Buf &b2) const noexcept { return (memcmp(unsafeData,b2.unsafeData,ZT_BUF_MEM_SIZE) != 0); } - ZT_ALWAYS_INLINE bool operator<(const Buf &b2) const noexcept { return (memcmp(unsafeData,b2.unsafeData,ZT_BUF_MEM_SIZE) < 0); } - ZT_ALWAYS_INLINE bool operator<=(const Buf &b2) const noexcept { return (memcmp(unsafeData,b2.unsafeData,ZT_BUF_MEM_SIZE) <= 0); } - ZT_ALWAYS_INLINE bool operator>(const Buf &b2) const noexcept { return (memcmp(unsafeData,b2.unsafeData,ZT_BUF_MEM_SIZE) > 0); } - ZT_ALWAYS_INLINE bool operator>=(const Buf &b2) const noexcept { return (memcmp(unsafeData,b2.unsafeData,ZT_BUF_MEM_SIZE) >= 0); } - /** * Raw data held in buffer * diff --git a/node/Fingerprint.hpp b/node/Fingerprint.hpp index 884b29174..4e443550a 100644 --- a/node/Fingerprint.hpp +++ b/node/Fingerprint.hpp @@ -35,15 +35,8 @@ class Fingerprint : public TriviallyCopyable { public: ZT_ALWAYS_INLINE Fingerprint() noexcept {} - explicit ZT_ALWAYS_INLINE Fingerprint(const void *h384) noexcept { memcpy(_h,h384,48); } - ZT_ALWAYS_INLINE void set(const void *h384) noexcept { memcpy(_h,h384,48); } - - ZT_ALWAYS_INLINE void zero() noexcept - { - for(unsigned int i=0;i<(384 / (sizeof(unsigned long) * 8));++i) - _h[i] = 0; - } + ZT_ALWAYS_INLINE void zero() noexcept { memoryZero(this); } ZT_ALWAYS_INLINE uint8_t *data() noexcept { return reinterpret_cast(_h); } ZT_ALWAYS_INLINE const uint8_t *data() const noexcept { return reinterpret_cast(_h); }