You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
Clear() only clears crtl and doesn't clear the groups #20
Clear() is not working as intended. g is a copy of the group, not the group itself. The tests pass because ctrl is cleared, which tricks the test into thinking that clear has worked because the keys can no longer be found. I also noticed that Clear() does not use newEmptyMetadata() so there is an optimisation to cache an empty meta and then just assign it control. The same optimisation could be applied to the groups by creating a zero group and the applying it to each group.
@rkerno Thanks for the bug report! I've gone ahead and updated the test and pushed a fix for the Clear() implementation. No optimizations there yet --- I agree that keeping an empty metadata around and using that as the right hand argument in the assignments when we need it would be more efficient. Hopefully I can get back to that soon.
Activity
reltuk commentedon Aug 28, 2023
@rkerno Thanks for the bug report! I've gone ahead and updated the test and pushed a fix for the Clear() implementation. No optimizations there yet --- I agree that keeping an empty metadata around and using that as the right hand argument in the assignments when we need it would be more efficient. Hopefully I can get back to that soon.
map.go: Fix Clear() to actually clear the values and keys.
map.go: Fix Clear() to actually clear the values and keys.
map.go: Fix Clear() to actually clear the values and keys.