diff options
author | Volker Lendecke <vl@samba.org> | 2018-07-26 15:46:18 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-09-07 17:26:18 +0200 |
commit | 9108572039e42fbc0ec540d8a89764d81597dd5d (patch) | |
tree | 1f8b3a01e6da74d6b14dc32bd360028b3b87cb07 /source3/smbd/oplock.c | |
parent | 6a7820141908084aaa002d3f4b8a984fcb67d2d9 (diff) | |
download | samba-9108572039e42fbc0ec540d8a89764d81597dd5d.tar.gz |
smbd: Simplify logic in fsp_lease_update
One if-condition is better than two
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r-- | source3/smbd/oplock.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index a23b87769e2..8073fbe3dca 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -400,11 +400,7 @@ bool fsp_lease_update(struct share_mode_lock *lck, 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; @@ -413,6 +409,8 @@ bool fsp_lease_update(struct share_mode_lock *lck, return false; } + l = &d->leases[idx]; + DEBUG(10,("%s: refresh lease state\n", __func__)); /* Ensure we're in sync with current lease state. */ |