Skip to content

Commit

Permalink
Keep operators inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Nov 26, 2024
1 parent 1179b30 commit bdced6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
14 changes: 0 additions & 14 deletions nano/node/scheduler/bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
13 changes: 10 additions & 3 deletions nano/node/scheduler/bucket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,20 @@ class bucket final
uint64_t time;
std::shared_ptr<nano::block> 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
Expand Down

0 comments on commit bdced6b

Please sign in to comment.