NetworkManager/src/settings
Thomas Haller d482eec6b2 ifcfg-rh: use binary search for converting string to ethtool ID
Don't do a linear search through all names, but use binary search.

Upside: calling nms_ifcfg_rh_utils_get_ethtool_by_name() in a loop
(once over all 60 names) is 75% faster.

Downside: when adding a new feature, we have yet another line that we
need to add. Previously, adding a new feature required adding 7 lines,
not it is 8. But we didn't add a single feature since this was added,
so that happens very seldom.

Possible downside: is this code harder to read? Now we track both how to
convert the ID to name and back. This is redundant (and thus harder to
maintain). But it's really just one extra line per feature, for which there
is a unit test. So, when adding a new NMEthtoolID it would be pretty
hard to mess this up, because of all the tests and assertions.
So, maybe it's slightly harder to read. On the other hand, it unifies
handling for ethtool and kernel names, and the code has less logic
and is more descriptive. I don't think this is actually harder to maintain
and it should be easy to see that it is correct (readability).
2020-03-06 09:52:27 +01:00
..
plugins ifcfg-rh: use binary search for converting string to ethtool ID 2020-03-06 09:52:27 +01:00
nm-agent-manager.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-agent-manager.h agent-manager: let nm_settings_connection_check_permission() check all secret-agents searching for permission 2019-12-31 02:13:45 +01:00
nm-secret-agent.c shared: drop _STATIC variant of macros that define functions 2020-02-13 17:17:07 +01:00
nm-secret-agent.h agent-manager: fix races registering secret agent and track auth-chain per agent 2019-12-31 02:13:45 +01:00
nm-settings-connection.c shared: drop _STATIC variant of macros that define functions 2020-02-13 17:17:07 +01:00
nm-settings-connection.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-settings-plugin.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-settings-plugin.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-settings-storage.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-settings-storage.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-settings-utils.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-settings-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-settings.c shared: drop _STATIC variant of macros that define functions 2020-02-13 17:17:07 +01:00
nm-settings.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00