You missed my point completely.
Type: Posts; User: grumpy
You missed my point completely.
The code is unnecessarily complicated. A hint to ponder: operator[] on a map will insert elements in certain circumstances.
Your usage of the variable i is the problem I see (I haven't...