Fixing list copy and grammar sentence generation

This commit is contained in:
IlushaShurupov 2023-08-11 18:49:45 +03:00
parent 43fe34dcbf
commit 0a886bd8a8
5 changed files with 38 additions and 13 deletions

View file

@ -243,7 +243,7 @@ namespace tp {
}
[[nodiscard]] bool operator==(const List& in) const {
if (in == *this) { return true; }
if (&in == this) { return true; }
if (in.length() != length()) {
return false;
}
@ -253,6 +253,8 @@ namespace tp {
if (left->data != right->data) {
return false;
}
left = left->next;
right = right->next;
}
if (left != right) {
return false;