gencache: Swap tests: Do cheapest first
authorVolker Lendecke <vl@samba.org>
Tue, 9 Oct 2018 11:15:22 +0000 (13:15 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 17 Oct 2018 17:22:19 +0000 (19:22 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/gencache.c

index 8919a1657455de9606058a376e16835e516d5f34..895c9cc05a72e9eba466d31ad33d19bc35d2aaff 100644 (file)
@@ -273,13 +273,13 @@ bool gencache_set_data_blob(const char *keystr, DATA_BLOB blob,
        static int writecount;
        TDB_DATA dbufs[2];
 
-       if (tdb_data_cmp(string_term_tdb_data(keystr),
-                        last_stabilize_key()) == 0) {
-               DEBUG(10, ("Can't store %s as a key\n", keystr));
+       if ((keystr == NULL) || (blob.data == NULL)) {
                return false;
        }
 
-       if ((keystr == NULL) || (blob.data == NULL)) {
+       if (tdb_data_cmp(string_term_tdb_data(keystr),
+                        last_stabilize_key()) == 0) {
+               DEBUG(10, ("Can't store %s as a key\n", keystr));
                return false;
        }