From: Fred Morcos Date: Tue, 23 Jul 2024 12:39:57 +0000 (+0200) Subject: Format lmdb-typed.cc X-Git-Tag: rec-5.2.0-alpha1~61^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d582a29939b4d889c6f784ed3467a3cbdddb4605;p=thirdparty%2Fpdns.git Format lmdb-typed.cc --- diff --git a/.not-formatted b/.not-formatted index 37df0d5065..904e4c65f3 100644 --- a/.not-formatted +++ b/.not-formatted @@ -1,6 +1,5 @@ ./ext/lmdb-safe/lmdb-safe.cc ./ext/lmdb-safe/lmdb-safe.hh -./ext/lmdb-safe/lmdb-typed.cc ./ext/lmdb-safe/lmdb-typed.hh ./ext/probds/murmur3.cc ./pdns/anadns.hh diff --git a/ext/lmdb-safe/lmdb-typed.cc b/ext/lmdb-safe/lmdb-typed.cc index 720285352d..1edc8324ff 100644 --- a/ext/lmdb-safe/lmdb-typed.cc +++ b/ext/lmdb-safe/lmdb-typed.cc @@ -6,7 +6,7 @@ unsigned int MDBGetMaxID(MDBRWTransaction& txn, MDBDbi& dbi) auto cursor = txn->getRWCursor(dbi); MDBOutVal maxidval, maxcontent; unsigned int maxid{0}; - if(!cursor.get(maxidval, maxcontent, MDB_LAST)) { + if (!cursor.get(maxidval, maxcontent, MDB_LAST)) { maxid = maxidval.getNoStripHeader(); } return maxid; @@ -16,13 +16,13 @@ unsigned int MDBGetRandomID(MDBRWTransaction& txn, MDBDbi& dbi) { auto cursor = txn->getRWCursor(dbi); unsigned int id; - for(int attempts=0; attempts<20; attempts++) { + for (int attempts = 0; attempts < 20; attempts++) { MDBOutVal key, content; // dns_random generates a random number in [0..signed_int_max-1]. We add 1 to avoid 0 and allow type_max. // 0 is avoided because the put() interface uses it to mean "please allocate a number for me" id = dns_random(std::numeric_limits::max()) + 1; - if(cursor.find(MDBInVal(id), key, content)) { + if (cursor.find(MDBInVal(id), key, content)) { return id; } }