Closed rfyiamcool closed 1 year ago
I'm not certain that this change is correct as currently written, since it doesn't track sz
and I think len(m.ctrl)
and len(m.groups)
will diverge here.
But, that being said, I'm not certain if Clear()
should be clearing groups
in general. We don't clear entries in groups
for (*Map).Delete()
.
I can see how it would be compelling in general to clear the groups
entry if there are retained pointers or slices in particular, since those will effectively leak otherwise.
Let me consult internally and see if this is something we want to change in general. I'll follow up on this PR shortly.
Thank you for the contribution!
I've just opened #16 as an alternative implementation and would appreciate your thoughts.
I merged #16 instead. Thanks again for your contribution and please do not hesitate to reach out if you have any follow up here.
change
the groups structure needs to be reset when clear swiss map ? if reset medata to empty, the memory not be cleaned.