From a5aecede9626611c8fc375a7976ed69079e706ee Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 26 Jun 2020 12:44:48 +0200 Subject: Use some of the new list.h features in minecctl --- minecctl/minecctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'minecctl/minecctl.c') diff --git a/minecctl/minecctl.c b/minecctl/minecctl.c index 6ccf413..bbe605b 100644 --- a/minecctl/minecctl.c +++ b/minecctl/minecctl.c @@ -303,9 +303,7 @@ set_server(const char *name) list_for_each_entry(server, &cfg->servers, list) { if (streq(name, server->shortname)) { - /* This puts the chosen server first in the list */ - list_del(&server->list); - list_add(&server->list, &cfg->servers); + list_rotate_to_front(&server->list, &cfg->servers); return; } } -- cgit v1.2.3