[SSSD] [PATCH] views: Add is_default_view helper function

Pavel Reichl preichl at redhat.com
Thu Jun 25 11:59:25 UTC 2015


On 06/25/2015 01:57 PM, Jakub Hrozek wrote:
> On Thu, Jun 25, 2015 at 11:05:28AM +0200, Pavel Reichl wrote:
>>
>> On 06/24/2015 06:46 PM, Michal Židek wrote:
>>> +static inline bool is_default_view(const char *view_name)
>>> +{
>>> +    /* NULL is treated as default */
>>> +    if (view_name == NULL
>>> +            || strcmp(view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
>>> +        return true;
>>> +    } else {
>>> +        return false;
>>> +    }
>>> +}
>>> +
>> Do you think that
>> {
>>      return view_name == NULL || strcmp(view_name,SYSDB_DEFAULT_VIEW_NAME) ==
>> 0;
>> }
>>
>> would be harder to read? (I'm just asking I'm not giving nack.)
> To me, the explicit true and false returns are easier.
OK, then please ignore my comment.
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel




More information about the sssd-devel mailing list