Skip to content

v2.2.0

Compare
Choose a tag to compare
@elliotchance elliotchance released this 04 Sep 18:48
· 3 commits to master since this release
b46f20e
Performance improvements (#30)

Notes:
- avoid allocating an Element when iterating using (*Element).Next() and (*Element).Prev()
- avoid allocating an Element when calling (*OrderedMap).Front() and (*OrderedMap).Back()
- avoid computing the length of the doubly linked list since it is not strictly needed

Advantages:
- no need of (*Element).list field: save both memory and assignations
- avoid comparisons in (*Element).Next() and (*Element).Prev(): save time
- allow implicit initialization: style
- avoid comparisons in (*list).Front() and (*list).Back(): save time
- keep almost the same execution time for (*list).Remove(), (*list).PushFront() and (*list).PushBack()