Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Be more defensive when iterating over sequence that changes dynamically #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Be more defensive when iterating over sequence that changes dynamically #92

wants to merge 1 commit into from

Conversation

zgoda-mobica
Copy link
Contributor

Otherwise you'll get into troubles.

@rockymeza
Copy link
Owner

Is this in relationship to #42? I'm hesitant to merge this, because while it won't throw an exception, the parsing logic could actually be wrong and I don't want to come out of the loop without parsing all the data. Perhaps we can resolve #42 first before this?

@zgoda-mobica
Copy link
Contributor Author

You modify sequence you're iterating over by pop()'ing from it, this is only check we still have anything left to consume in the sequence, it does not skip anything.

Other option could be to iterate over a shallow copy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants