Skip to content

Commit

Permalink
refactor: Remove redundant automatically created operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Adda0 committed Jul 9, 2024
1 parent b660050 commit fdd668a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion include/mata/nfa/delta.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct Transition {
: source(source), symbol(symbol), target(target) {}

bool operator==(const Transition& rhs) const { return source == rhs.source && symbol == rhs.symbol && target == rhs.target; }
bool operator!=(const Transition& rhs) const { return !this->operator==(rhs); }
};

/**
Expand Down
1 change: 0 additions & 1 deletion include/mata/parser/parser.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ struct ParsedSection {

/// Equality operator
bool operator==(const ParsedSection& rhs) const;
bool operator!=(const ParsedSection& rhs) const { return !(*this == rhs); }

/// subscript operator for the key-value store
const std::vector<std::string>& operator[](const std::string& key) const;
Expand Down
22 changes: 4 additions & 18 deletions include/mata/utils/closed-set.hh
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,9 @@ struct ClosedSet {
insert(antichain);
}

// operators

// Two closed sets are equivalent iff their type, borders
// and corresponding antichains are the same
bool operator==(const ClosedSet<T>& rhs) const
{ // {{{
return type_ == rhs.type && min_val_ == rhs.min_val &&
max_val_ == rhs.max_val && antichain_ == rhs.antichain;
} // operator== }}}

// Two closed sets are not equivalent iff their type,
// borders or corresponding antichains differ
bool operator!=(const ClosedSet<T>& rhs) const
{ // {{{
return type_ != rhs.type_ || min_val_ != rhs.min_val_ ||
max_val_ != rhs.max_val_ || antichain_ != rhs.antichain_;
} // operator!= }}}
/// Two closed sets are equivalent iff their type, borders and corresponding antichains are the same. They are
/// not equivalent otherwise.
bool operator==(const ClosedSet<T>& rhs) const = default;

// A closed set is considered to be smaller than the other one iff
// it is a subset of the other one
Expand All @@ -147,7 +133,7 @@ struct ClosedSet {
bool operator>=(const ClosedSet<T>& rhs) const
{ // {{{
assert(type_ == rhs.type_ && min_val_ == rhs.min_val_ && max_val_ == rhs.max_val_ &&
"Types and borders of given closed sets must be the same to perform their <=-comparison.");
"Types and borders of given closed sets must be the same to perform their >=-comparison.");
return contains(rhs.antichain);
} // operator<= }}}

Expand Down
1 change: 0 additions & 1 deletion include/mata/utils/ord-vector.hh
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ public:
assert(rhs.vectorIsSorted());
return (vec_ == rhs.vec_);
}
bool operator!=(const OrdVector& rhs) const { return !(*this == rhs); }

bool operator<(const OrdVector& rhs) const {
assert(vectorIsSorted());
Expand Down

0 comments on commit fdd668a

Please sign in to comment.