One if-condition is better than two
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
struct share_mode_lease *l = NULL;
idx = find_share_mode_lease(d, client_guid, &lease->lease.lease_key);
- if (idx != -1) {
- l = &d->leases[idx];
- }
-
- if (l == NULL) {
+ if (idx == -1) {
DEBUG(1, ("%s: Could not find lease entry\n", __func__));
TALLOC_FREE(lease->timeout);
lease->lease.lease_state = SMB2_LEASE_NONE;
return false;
}
+ l = &d->leases[idx];
+
DEBUG(10,("%s: refresh lease state\n", __func__));
/* Ensure we're in sync with current lease state. */