John Darrington <[EMAIL PROTECTED]> writes:

> Isn't the right hand side of this statement redundant ?
>
>  ok = trns_chain_destroy (ds->temporary_trns_chain) && ok;

I don't think so.  If `ok' was false before this, then it is
false afterward.  If trns_chain_destroy fails here, then `ok' is
false afterward.  Otherwise, `ok' is true afterward.

The order of the && operands can't be reversed, because that
would keep trns_chain_destroy from being called if `ok' was
already false.

It could be rewritten as:
        if (!trns_chain_destroy (ds->temporary_trns_chain))
          ok = false;
If you find that easier to read, I wouldn't object.  It is more
straightforward to read.  I used this idiom a few other places in
that file (search for `&&'), so you might want to update those
too, if you decide to change this one.

> Also, I wonder about the next two lines: 
>  
>   ds->permanent_trns_chain = ds->cur_trns_chain = trns_chain_create ();
>   ds->temporary_trns_chain = NULL;
>
> Why assign ds->permanent_trns_chain to something, and then to
> immediately to something else?

I don't think I understand the question.
ds->permanent_trns_chain is only assigned to once in those lines.
-- 
Ben Pfaff 
email: [EMAIL PROTECTED]
web: http://benpfaff.org


_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to