Re: [hackers] [dwm] [PATCH] get rid of unnecessary ternary operator

From: Laslo Hunhold <>
Date: Thu, 27 Oct 2016 12:41:25 +0200

On Thu, 27 Oct 2016 10:02:32 +0200
Anselm R Garbe <> wrote:

Hey Anselm,

> To me ! is logical NOT and your suggestion relies on the fact that
> XUrgencyHint is a single bit flag? no?
> I prefer the original code, as it doesn't use side effects of logical
> NOTs.

this is exactly what was checked with the ternary operator. The
bitmask-result is also "so to say" casted to a boolean value, and
!! is inverse-idempotent on booleans, which means that we are save
here. I prefer Markus' approach, but it's your decision as a maintainer.



Laslo Hunhold <>
Received on Thu Oct 27 2016 - 12:41:25 CEST

This archive was generated by hypermail 2.3.0 : Thu Oct 27 2016 - 12:48:14 CEST