dbwrap_watch: Slightly simplify dbwrap_watched_fetch_locked()
authorVolker Lendecke <vl@samba.org>
Mon, 30 Sep 2019 05:48:34 +0000 (07:48 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 2 Oct 2019 08:01:41 +0000 (08:01 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/dbwrap/dbwrap_watch.c

index b1a82d86006def93f010fde42bb4e84f7aaac651..902643ca307d06beca5157467e2c5b9d3ce976a9 100644 (file)
@@ -255,6 +255,7 @@ static struct db_record *dbwrap_watched_fetch_locked(
        if (!ok) {
                return rec;     /* fresh record */
        }
+       rec->value = subrec->wrec.data;
 
        /*
         * subrec->wrec.watchers points *directly* into the
@@ -272,10 +273,6 @@ static struct db_record *dbwrap_watched_fetch_locked(
        }
        subrec->wrec.watchers = watchers;
 
-       if (ok) {
-               rec->value = subrec->wrec.data;
-       }
-
        return rec;
 }