From: Albert Safin Date: Sat, 8 Dec 2018 23:15:53 +0000 (+0700) Subject: Remove unused con_get_next() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b6282b47bc757c3521eff090748bc81481913297;p=i3%2Fi3 Remove unused con_get_next() This function has unused for a long time since the commit 8f4b9ddaa43ae61932fd702ad7178c2b4e07cfb9. --- diff --git a/include/con.h b/include/con.h index 88992076..09ec7b44 100644 --- a/include/con.h +++ b/include/con.h @@ -378,13 +378,6 @@ orientation_t con_orientation(Con *con); */ Con *con_next_focused(Con *con); -/** - * Get the next/previous container in the specified orientation. This may - * travel up until it finds a container with suitable orientation. - * - */ -Con *con_get_next(Con *con, char way, orientation_t orientation); - /** * Returns the focused con inside this client, descending the tree as far as * possible. This comes in handy when attaching a con to a workspace at the diff --git a/src/con.c b/src/con.c index 764419dc..f904bfe8 100644 --- a/src/con.c +++ b/src/con.c @@ -1485,42 +1485,6 @@ Con *con_next_focused(Con *con) { return next; } -/* - * Get the next/previous container in the specified orientation. This may - * travel up until it finds a container with suitable orientation. - * - */ -Con *con_get_next(Con *con, char way, orientation_t orientation) { - DLOG("con_get_next(way=%c, orientation=%d)\n", way, orientation); - /* 1: get the first parent with the same orientation */ - Con *cur = con; - while (con_orientation(cur->parent) != orientation) { - DLOG("need to go one level further up\n"); - if (cur->parent->type == CT_WORKSPACE) { - LOG("that's a workspace, we can't go further up\n"); - return NULL; - } - cur = cur->parent; - } - - /* 2: chose next (or previous) */ - Con *next; - if (way == 'n') { - next = TAILQ_NEXT(cur, nodes); - /* if we are at the end of the list, we need to wrap */ - if (next == TAILQ_END(&(parent->nodes_head))) - return NULL; - } else { - next = TAILQ_PREV(cur, nodes_head, nodes); - /* if we are at the end of the list, we need to wrap */ - if (next == TAILQ_END(&(cur->nodes_head))) - return NULL; - } - DLOG("next = %p\n", next); - - return next; -} - /* * Returns the focused con inside this client, descending the tree as far as * possible. This comes in handy when attaching a con to a workspace at the