From: Lennart Poettering Date: Fri, 30 Apr 2021 21:08:55 +0000 (+0200) Subject: userdb: remove unnecesary repeated if check X-Git-Tag: v249-rc1~286^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77fe7d15931cc17c933ae8778c4161112783dc79;p=thirdparty%2Fsystemd.git userdb: remove unnecesary repeated if check --- diff --git a/src/shared/userdb.c b/src/shared/userdb.c index e188123e2e1..149a8e1a0ea 100644 --- a/src/shared/userdb.c +++ b/src/shared/userdb.c @@ -776,11 +776,11 @@ int userdb_iterator_get(UserDBIterator *iterator, UserRecord **ret) { iterator->n_found++; return synthetic_nobody_user_build(ret); } - } - /* if we found at least one entry, then ignore errors and indicate that we reached the end */ - if (r < 0 && iterator->n_found > 0) - return -ESRCH; + /* if we found at least one entry, then ignore errors and indicate that we reached the end */ + if (iterator->n_found > 0) + return -ESRCH; + } return r; } @@ -975,11 +975,11 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) { iterator->n_found++; return synthetic_nobody_group_build(ret); } - } - /* if we found at least one entry, then ignore errors and indicate that we reached the end */ - if (r < 0 && iterator->n_found > 0) - return -ESRCH; + /* if we found at least one entry, then ignore errors and indicate that we reached the end */ + if (iterator->n_found > 0) + return -ESRCH; + } return r; }