From: n0tlu5 Date: Sat, 28 Dec 2024 09:55:53 +0000 (+0700) Subject: follow readability-braces-around-statements lint X-Git-Tag: dnsdist-2.0.0-alpha1~178^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=280f44789a69f78f49439b6a80ab69da9622a966;p=thirdparty%2Fpdns.git follow readability-braces-around-statements lint --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index cd10d732fe..8dd0f83517 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -1198,14 +1198,12 @@ static void setupLuaRecords(LuaContext& lua) // NOLINT(readability-function-cogn for (auto& entry : conv) { int weight = 0; weight = g_up.isUp(entry, url, opts); - if(weight>0){ + if(weight>0) available = 1; - } items.emplace_back(weight, entry); } - if(available) { + if(available) return pickWeightedHashed(s_lua_record_ctx->bestwho, items).toString(); - } // All units down, apply backupSelector on all candidates return pickWeightedRandom(items).toString();