mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 19:32:07 +00:00
24 lines
623 B
C++
24 lines
623 B
C++
#include <Access/Quota.h>
|
|
#include <boost/range/algorithm/equal.hpp>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
bool operator ==(const Quota::Limits & lhs, const Quota::Limits & rhs)
|
|
{
|
|
return boost::range::equal(lhs.max, rhs.max) && (lhs.duration == rhs.duration)
|
|
&& (lhs.randomize_interval == rhs.randomize_interval);
|
|
}
|
|
|
|
|
|
bool Quota::equal(const IAccessEntity & other) const
|
|
{
|
|
if (!IAccessEntity::equal(other))
|
|
return false;
|
|
const auto & other_quota = typeid_cast<const Quota &>(other);
|
|
return (all_limits == other_quota.all_limits) && (key_type == other_quota.key_type) && (to_roles == other_quota.to_roles);
|
|
}
|
|
|
|
}
|
|
|