Indigo
Indigo copied to clipboard
core: replace `RedBlackMap` and `RedBlackSet` implementation with standard containers
Motivation
Currently Indigo uses own-written implementation of ordered associative containers and ordered sets using red-black trees. The implementation could be found in core/indigo-core/common/base_cpp/red_black.h
.
In many cases order of elements is not important and int
is a key type, so it could be easily replaced with hash maps and also lead to performance improvement. Same for unordered sets.
ToDo
- Find all places in code that use
RedBlackMap<K, V>
, check if K is trivially hashable and order of elements is required, and replace it withstd::map<K, V>
orstd::unordered_map<K, V>
depending on the situation. - Find all places in code that use
RedBlackSet<K>
, check if K is trivially hashable and order of elements is required, and replace it withstd::set<K>
orstd::unordered_set<K>
depending on the situation. - Check if
core/indigo-core/common/base_cpp/red_black.h
and eliminate it if it's not required anymore.