>>>>> Guillem Jover <guil...@hadrons.org> writes:
>>>>> On Thu, 2013-11-21 at 13:11:05 +0100, Marin Ramesa wrote:

[…]

 >>             db_sym_t sp;
 >> -           if (sp = X_db_lookup(&db_symtabs[i], sym_name)) {
 >> +           boolean_t db_lookup;
 >> +           db_lookup = (int)(sp = X_db_lookup(&db_symtabs[i], sym_name));
 >> +           if (db_lookup) {
 >>                     if (found_once)

[…]

 > Regarding readability, this does not seem to me like a big
 > improvement (bar the squashed warning :).  Why not assign sp on its
 > own?  And does the db_sym_t type require a cast for the conditional?

        I’d rather question the necessity of adding a new variable just
        to hold the “boolean.”  Why not simply:

-               if (sp = X_db_lookup(&db_symtabs[i], sym_name)) {
+               sp = X_db_lookup(&db_symtabs[i], sym_name);
+               if (sp) {

        (Or perhaps sp != 0, or similar.)

PS.  Even though I like it with just the extra parenthesis.

-- 
FSF associate member #7257

Reply via email to