Messages in this thread | | | Subject | Re: [PATCH 1/6] staging: android: binder: Remove some funny && usage | From | Daniel Walker <> | Date | Wed, 17 Jun 2009 07:37:49 -0700 |
| |
On Tue, 2009-06-16 at 13:46 -0700, Jeremy Fitzhardinge wrote: > > > > retry: > > - wait_for_proc_work = thread->transaction_stack == NULL&& > > - list_empty(&thread->todo); > > + if (list_empty(&thread->todo)&& thread->transaction_stack == NULL) > > + wait_for_proc_work = 1; > > > > I think the original looks cleaner (in both cases). Assigning a > variable with the result of a boolean expression is perfectly > reasonable. Perhaps change the type of the variable to "bool" to make > it a bit clearer what's going on.
I agree it's reasonable in some cases.. The reason I changed this is because at first glance I didn't know what those lines were suppose to do. The equals signs all bleed together combined with the length of the statement makes it not match other similar usage. The if statement just makes the whole thing explicit.
Not to mention this code is a mess, very dense, and has little or no comments. Anything that can be done to make the code more clear, seem like a cleanup to me.
As for using "bool" , AFAIK that's only part of C++ ..
Daniel
| |