mirror of
https://github.com/tmux/tmux.git
synced 2025-09-05 08:07:03 +00:00
Store sessions in an RB tree by name rather than a list, this is tidier
and allows them to easily be shown sorted in various lists (list-sessions/choose-sessions). Keep a session index which is used in a couple of places internally but make it an ever-increasing number rather than filling in gaps with new sessions.
This commit is contained in:
@ -38,17 +38,14 @@ server_window_loop(void)
|
||||
struct winlink *wl;
|
||||
struct window_pane *wp;
|
||||
struct session *s;
|
||||
u_int i, j;
|
||||
u_int i;
|
||||
|
||||
for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
|
||||
w = ARRAY_ITEM(&windows, i);
|
||||
if (w == NULL)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < ARRAY_LENGTH(&sessions); j++) {
|
||||
s = ARRAY_ITEM(&sessions, j);
|
||||
if (s == NULL)
|
||||
continue;
|
||||
RB_FOREACH(s, sessions, &sessions) {
|
||||
wl = session_has(s, w);
|
||||
if (wl == NULL)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user