Skip to content

Commit

Permalink
refactor: CheckIntersection
Browse files Browse the repository at this point in the history
  • Loading branch information
PokIsemaine committed Jul 1, 2024
1 parent f0c4b5e commit 64a7c64
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/cluster/cluster_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ struct SlotRange {
bool Contain(int slot) const { return IsValid() && slot >= start && slot <= end; }

bool CheckIntersection(const SlotRange &rhs) const {
if (!IsValid() || !rhs.IsValid()) return false;
if (start < rhs.start && end < rhs.start) return false;
if (rhs.start < start && rhs.end < start) return false;
if (!IsValid() || !rhs.IsValid() || end < rhs.start || rhs.end < start) return false;
return true;
}
std::string String() const {
Expand Down

0 comments on commit 64a7c64

Please sign in to comment.