Closed ThomasColthurst closed 1 month ago
Why do you figure they used unordered_map here?
Probably that was their default (for the slight efficiency win over map?), and then when they added the table_weights methods they didn't realize that map<> would be more efficient.
and use it to make the code more understandable and more efficient.
Also, switch the table_weights() return values from unordered_map's to map's, so that their maximum key can be compute in O(1) time.