From c82c3f08356d4debd69f1f15be3fc065a2010b8e Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 2 Sep 2016 16:07:11 +0000 Subject: Simplify group_holds_only_hidden(); from Vadim Vygonets. --- group.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'group.c') diff --git a/group.c b/group.c index c39e0f1..81961e7 100644 --- a/group.c +++ b/group.c @@ -209,19 +209,12 @@ int group_holds_only_hidden(struct group_ctx *gc) { struct client_ctx *cc; - int hidden = 0, same = 0; TAILQ_FOREACH(cc, &gc->clientq, group_entry) { - if (cc->flags & CLIENT_STICKY) - continue; - if (hidden == ((cc->flags & CLIENT_HIDDEN) ? 1 : 0)) - same++; + if (!(cc->flags & (CLIENT_HIDDEN | CLIENT_STICKY))) + return(0); } - - if (same == 0) - hidden = !hidden; - - return(hidden); + return(1); } void -- cgit 1.4.1