From bdced6bb38a1106f110fbb358d728d0fecfc7045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 25 Nov 2024 18:11:08 +0100 Subject: [PATCH] Keep operators inlined --- nano/node/scheduler/bucket.cpp | 14 -------------- nano/node/scheduler/bucket.hpp | 13 ++++++++++--- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/nano/node/scheduler/bucket.cpp b/nano/node/scheduler/bucket.cpp index 4e4ecb0a50..de9083b34f 100644 --- a/nano/node/scheduler/bucket.cpp +++ b/nano/node/scheduler/bucket.cpp @@ -189,20 +189,6 @@ void nano::scheduler::bucket::dump () const } } -/* - * block_entry - */ - -bool nano::scheduler::bucket::block_entry::operator< (block_entry const & other_a) const -{ - return time < other_a.time || (time == other_a.time && block->hash () < other_a.block->hash ()); -} - -bool nano::scheduler::bucket::block_entry::operator== (block_entry const & other_a) const -{ - return time == other_a.time && block->hash () == other_a.block->hash (); -} - /* * priority_bucket_config */ diff --git a/nano/node/scheduler/bucket.hpp b/nano/node/scheduler/bucket.hpp index b5b12b2b87..be82aecf84 100644 --- a/nano/node/scheduler/bucket.hpp +++ b/nano/node/scheduler/bucket.hpp @@ -83,13 +83,20 @@ class bucket final uint64_t time; std::shared_ptr block; - bool operator< (block_entry const & other) const; - bool operator== (block_entry const & other) const; - nano::block_hash hash () const { return block->hash (); } + + // Keep operators inlined + bool operator< (block_entry const & other) const + { + return time < other.time || (time == other.time && hash () < other.hash ()); + } + bool operator== (block_entry const & other) const + { + return time == other.time && hash () == other.hash (); + } }; // clang-format off