From a7d742937644373e0e2e75003d04c118e34385ff Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 3 Sep 2013 14:38:47 +0000 Subject: [PATCH] smbd: Simplify find_share_mode_entry There's no point checking the validity of the "entry" argument more than once Signed-off-by: Volker Lendecke Reviewed-by: Michael Adam --- source3/locking/locking.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 5090082ba8..1567f8ffcd 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -751,10 +751,13 @@ static struct share_mode_entry *find_share_mode_entry(struct share_mode_data *d, { int i; + if (!is_valid_share_mode_entry(entry)) { + return NULL; + } + for (i=0; inum_share_modes; i++) { struct share_mode_entry *e = &d->share_modes[i]; - if (is_valid_share_mode_entry(entry) && - is_valid_share_mode_entry(e) && + if (is_valid_share_mode_entry(e) && share_modes_identical(e, entry)) { return e; } -- 2.34.1