summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2016-09-02 16:07:12 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2016-09-02 16:07:12 +0000
commit6f9971942d812ca69e51779fe74b399b1ebdbaff (patch)
tree8fc749260b2bed83b87209f7f74978837f68855d /app
parent72276a1d916fe7d78f6a44d4c4444a1dd4e6a294 (diff)
Simplify group_holds_only_hidden(); from Vadim Vygonets.
Diffstat (limited to 'app')
-rw-r--r--app/cwm/group.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/app/cwm/group.c b/app/cwm/group.c
index a671f332e..93c72b94a 100644
--- a/app/cwm/group.c
+++ b/app/cwm/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: group.c,v 1.121 2015/11/10 20:05:33 okan Exp $
+ * $OpenBSD: group.c,v 1.122 2016/09/02 16:07:11 okan Exp $
*/
#include <sys/types.h>
@@ -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