The LinkedHashMap's Remove is O(n) ? #120
Labels
No labels
bug
discussion
documentation
duplicate
ignore
new feature
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
golibs/gms-gods#120
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The LinkedHashMap's
Removeis O(n) ?Indeed, you are right. I should note that in documentation perhaps to be clear on that.
As the name suggests, the underlying structure to hold keys is a linked list in order to have the keys in the insertion order. Somebody requested this, so I've implemented it.
One could, however, implement a reversed lookup for this to find the index with O(1), but that would add more memory usage to the structure. If you feel like that's a good compromise in terms of performance vs memory, that I could change that or you can feel three to change it.