mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-23 04:25:21 +00:00
util/dictionary.h: alphabetically sorted for_each
This patch reverses the AVL-tree criterion to let 'for_each' traverse the elements in alphabetical sorting order. Issue #4610
This commit is contained in:
parent
0e311845bf
commit
be7022dadc
@ -44,7 +44,7 @@ class Genode::Dictionary : Noncopyable
|
||||
|
||||
Dictionary<T, NAME> &_dictionary;
|
||||
|
||||
bool higher(T const *other) const { return name > other->This::name; }
|
||||
bool higher(T const *other) const { return other->This::name > name; }
|
||||
|
||||
friend class Avl_tree<T>;
|
||||
friend class Avl_node<T>;
|
||||
@ -52,7 +52,7 @@ class Genode::Dictionary : Noncopyable
|
||||
|
||||
static T *_matching_sub_tree(T &curr, NAME const &name)
|
||||
{
|
||||
typename Avl_node<T>::Side side = (curr.This::name > name);
|
||||
typename Avl_node<T>::Side side = (name > curr.This::name);
|
||||
return curr.Avl_node<T>::child(side);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user