Dimitris Papastamos wrote: > On Fri, May 08, 2015 at 06:13:21PM +0200, Markus Teich wrote: > > + color = len ? INPUT : (failure || failonclear ? FAILED > > : INIT); > > I would split this condition out. Looks good for the rest.
Heyho, I think it is pretty readable for a nested ?: operator: - Not used in a functioncall, just a simple assignment. - The nested one is in the false part. - No inversions or calculations. Splitting it into something like the following doesn't seem easier to grasp: color = INPUT; if (!len) color = failure || failonclear ? FAILED : INIT; or color = failure || failonclear ? FAILED : INIT; if (len) color = INPUT; If there are no other strong arguments against it, I would like to keep it as proposed. --Markus