Collection was modified; enumeration operation may not execute

后端 未结 16 2573
南旧
南旧 2020-11-21 06:05

I can\'t get to the bottom of this error, because when the debugger is attached, it does not seem to occur.

Collection was modified; enumeration operatio

16条回答
  •  遇见更好的自我
    2020-11-21 06:50

    Actually the problem seems to me that you are removing elements from the list and expecting to continue to read the list as if nothing had happened.

    What you really need to do is to start from the end and back to the begining. Even if you remove elements from the list you will be able to continue reading it.

提交回复
热议问题