diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-12-21 22:37:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-12-21 22:37:59 +0000 |
commit | acf13ce9784111ca1e42ffc8206e752668476859 (patch) | |
tree | 49ccd47b2e589a27dab8657d516133205f07f393 /cmd-attach-session.c | |
parent | 1b8488ee75458c4561089bf056c0e911de958428 (diff) | |
download | rtmux-acf13ce9784111ca1e42ffc8206e752668476859.tar.gz rtmux-acf13ce9784111ca1e42ffc8206e752668476859.tar.bz2 rtmux-acf13ce9784111ca1e42ffc8206e752668476859.zip |
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.
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r-- | cmd-attach-session.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c index dbc43141..13fabc8d 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -47,7 +47,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) char *overrides, *cause; u_int i; - if (ARRAY_LENGTH(&sessions) == 0) { + if (RB_EMPTY(&sessions)) { ctx->error(ctx, "no sessions"); return (-1); } |