From be7022dadc1c2e4f036161563cc8dad2c5041595 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 10 Jan 2023 16:46:54 +0100 Subject: [PATCH] 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 --- repos/base/include/util/dictionary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/base/include/util/dictionary.h b/repos/base/include/util/dictionary.h index c393b0776c..f7c1ac9be2 100644 --- a/repos/base/include/util/dictionary.h +++ b/repos/base/include/util/dictionary.h @@ -44,7 +44,7 @@ class Genode::Dictionary : Noncopyable Dictionary &_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; friend class Avl_node; @@ -52,7 +52,7 @@ class Genode::Dictionary : Noncopyable static T *_matching_sub_tree(T &curr, NAME const &name) { - typename Avl_node::Side side = (curr.This::name > name); + typename Avl_node::Side side = (name > curr.This::name); return curr.Avl_node::child(side); }