Skip to content

Commit

Permalink
Improve performance of comparing requests' target with a single node uid
Browse files Browse the repository at this point in the history
  • Loading branch information
SSoelvsten committed Nov 15, 2023
1 parent c844f0b commit 1f6ab34
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/adiar/internal/data_types/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,15 @@ namespace adiar::internal
inline bool operator> (const tuple &o) const
{ return (o < *this); }

////////////////////////////////////////////////////////////////////////////
/// \brief Comparison with a single element.
////////////////////////////////////////////////////////////////////////////
inline bool operator== (const value_type &o) const
{
static_assert(cardinality == 1);
return this->_values[0] == o;
}

////////////////////////////////////////////////////////////////////////////
/// \brief Point-wise Equality.
////////////////////////////////////////////////////////////////////////////
Expand All @@ -381,6 +390,15 @@ namespace adiar::internal
inline bool operator!= (const tuple &o) const
{ return !(*this == o); }

////////////////////////////////////////////////////////////////////////////
/// \brief Comparison with a single element.
////////////////////////////////////////////////////////////////////////////
inline bool operator!= (const value_type &o) const
{
static_assert(cardinality == 1);
return this->_values[0] != o;
}

////////////////////////////////////////////////////////////////////////////
/// \brief Lexicographical Less-Than and Equality.
////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 1f6ab34

Please sign in to comment.