From 90fd77548234d0f640938c37dee010f2c785cafa Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 18 Apr 2020 22:41:47 -0700 Subject: [PATCH] ircd::m::room::power: Cleanup with decompositions. --- matrix/room_power.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/matrix/room_power.cc b/matrix/room_power.cc index c40a29ab9..a871165b7 100644 --- a/matrix/room_power.cc +++ b/matrix/room_power.cc @@ -407,8 +407,8 @@ const view([&ret] (const json::object &content) { - for(const auto &member : content) - ret += json::type(member.second) == json::OBJECT; + for(const auto &[key, val] : content) + ret += json::type(val) == json::OBJECT; }); return ret; @@ -572,18 +572,18 @@ const for(auto it(begin(collection)); it != end(collection) && ret; ++it) { - const auto &member(*it); - if(json::type(unquote(member.second)) != json::NUMBER) + const auto &[key_, val_] {*it}; + if(json::type(unquote(val_)) != json::NUMBER) continue; const json::string &key { - member.first + key_ }; const auto &val { - lex_cast(member.second) + lex_cast(val_) }; ret = closure(key, val);