From dc6ec6ce7b8d9be80a044afa24f6e76b846bef54 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 4 Nov 2020 13:53:57 +0100 Subject: core: reverse the order of active connections in the manager When a new active connection is created, it gets added at the beginning of manager's list. This means that the list contains most recently activated connections first. Since the list is doubly-linked, it is possible to efficiently iterate in both directions, so the order of the list is mostly a matter of convention. I think it is preferable to have oldest active connections at the beginning of the list; let's reverse the order. In most places where the list is iterated, the order doesn't matter. Where it does, use the *_prev() variant to maintain the old iteration order. --- .clang-format | 1 + 1 file changed, 1 insertion(+) (limited to '.clang-format') diff --git a/.clang-format b/.clang-format index b0233c0d09..33a0c63993 100644 --- a/.clang-format +++ b/.clang-format @@ -109,6 +109,7 @@ ForEachMacros: ['c_list_for_each', 'nm_l3_config_data_iter_ip6_route_for_each', 'nm_l3_config_data_iter_obj_for_each', 'nm_manager_for_each_active_connection', + 'nm_manager_for_each_active_connection_prev', 'nm_manager_for_each_active_connection_safe', 'nm_manager_for_each_device', 'nm_manager_for_each_device_safe', -- cgit v1.2.1