Taylorh140 Posted May 18, 2020 Report Share Posted May 18, 2020 So the way the map works is we can iterate all elements in the map by indexing on the input of a for or a while. However, This only works for a non-changing Map. if you are adding elements during the loop is there a good way of iterating all non-iterated items? Id like to have a version without a duplicate structure: I have these: This might be the best that can be done. but I thought id ask. Quote Link to comment
Aristos Queue Posted May 19, 2020 Report Share Posted May 19, 2020 Place any new items in a separate map and then merge them after the loop finishes. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.