Skip to content

Commit

Permalink
cleaning equality (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtofalex authored Oct 30, 2024
1 parent 5f87349 commit f254cae
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/core/NajaCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -1078,21 +1078,21 @@ template<class Type> class NajaCollection {
size_t size() const { if (collection_) { return collection_->size(); } return 0; }
bool empty() const { if (collection_) { return collection_->empty(); } return true; }

//comperator
bool operator==(const NajaCollection<Type>& r) const {
if (size() == r.size()) {
auto it = begin();
auto rit = r.begin();
while (it != end()) {
if (*it != *rit) {
return false;
}
++it;
++rit;
}
return true;
}
return false;
//comparator
bool operator==(const NajaCollection& r) const {
if (size() == r.size()) {
auto it = begin();
auto rit = r.begin();
while (it != end()) {
if (*it != *rit) {
return false;
}
++it;
++rit;
}
return true;
}
return false;
}
private:
const NajaBaseCollection<Type>* collection_ {nullptr};
Expand Down

0 comments on commit f254cae

Please sign in to comment.