Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed errors when List::erase() can't find the value #34028

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

pouleyKetchoupp
Copy link
Contributor

This change makes the behavior consistent when the value is not found between erasing from an empty list (no error, just returning false) and erasing from a non-empty list (previously triggering an error and returning false).

Error message previously triggered:

ERROR: erase: Condition ' !p_I ' is true. returned: false
   At: ./core/list.h:157.

@akien-mga
Copy link
Member

I'm not against it, but how catch situations when we're trying to erase something which doesn't exist?

@pouleyKetchoupp
Copy link
Contributor Author

If we do want to catch all these situations, then it should be consistent and raise an error when the list is empty as well, and we'll have to fix these cases.
I would be more leaning toward not enforcing this behavior in the whole codebase, and decide specifically in different situations if we want to add an error when the element is not found.

@aaronfranke
Copy link
Member

@pouleyKetchoupp Is this still desired? If so, it needs to be rebased on the latest master branch.

This change makes the behavior consistent when the value
is not found between erasing from an empty list
(no error, just returning false) and erasing from a non-empty list
(previously displaying triggering an error and returning false).

Error message previously triggered:
ERROR: erase: Condition ' !p_I ' is true. returned: false
   At: ./core/list.h:157.
@pouleyKetchoupp
Copy link
Contributor Author

I think it's still relevant in order to make things consistent, just rebased on master.

@akien-mga akien-mga merged commit c069f5f into godotengine:master Jul 2, 2020
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp pouleyKetchoupp deleted the list-erase-not-found branch July 2, 2020 12:04
Xrayez added a commit to goostengine/goost that referenced this pull request Sep 13, 2020
For consistency with godotengine/godot#34028.

Note that `erase` was renamed to `remove` in Goost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants