forked from TeamInklings/Octobot
Octol1ttle
438ecfb41b
This PR closes #105 This PR fixes exceptions caused by changing a collection's contents while it is being enumerated. This can often happen with Guild- and MemberDatas. By using `ToArray()` on these global collections and using it in the `foreach` loop, we create a new copy of the collection, preventing any modification to it. While this does introduce a lot of memory allocations, there is no fixing that. Usually, the fix to these exceptions would be to convert the `foreach` to a reverse-`for`. However, because indices cannot be used on these collections, that is not possible. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> |
||
---|---|---|
.. | ||
Update | ||
BackgroundGuildDataSaverService.cs | ||
GuildDataService.cs | ||
UtilityService.cs |