dbwrap_tool: Simplify persistent/non-persistent check / dbwrap_tool: Avoid an unnecessary "else"

Ralph Böhme slow at samba.org
Mon Sep 3 21:30:20 UTC 2018


Howdy,

On Tue, Sep 04, 2018 at 09:11:32AM +1200, Andrew Bartlett wrote:
>While each of these looks reasonable on its own, is this really the
>clearest (rather than cleverest) possible way this could have been
>constructed as a whole?

s/clearest/clearer/

yes. The clearest way? Who knows. Patches welcome.

>> -       if ((persistent == 0 && non_persistent == 0) ||
>> -           (persistent == 1 && non_persistent == 1))
>> -       {
>> +       if ((persistent + non_persistent) != 1) {
>>                 d_fprintf(stderr, "ERROR: you must specify exactly one "
>>                           "of --persistent and --non-persistent\n");
>>                 goto done;
>> -       } else if (non_persistent == 1) {
>> +       }
>> +       if (non_persistent == 1) {
>>                 tdb_flags |= TDB_CLEAR_IF_FIRST;
>>         }
>
>What specifically was the goal of the change here?

What specifically is the goal of this rhetorical question?

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46



More information about the samba-technical mailing list