diff --git a/include/ircd/m/event/prev.h b/include/ircd/m/event/prev.h index 86d164115..a3af2f7d5 100644 --- a/include/ircd/m/event/prev.h +++ b/include/ircd/m/event/prev.h @@ -75,7 +75,8 @@ ircd::m::event::prev::ids(event::id (&out)[N]) const { size_t i(0); - m::for_each(*this, [&i, &out](const event::id &event_id) + m::for_each(*this, [&i, &out] + (const event::id &event_id) noexcept { out[i++] = event_id; return i < N; diff --git a/ircd/ctx.cc b/ircd/ctx.cc index fa177be0b..ecc579bb7 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -1360,7 +1360,7 @@ ircd::ctx::context::join() assert(bool(c)); mark(prof::event::JOIN); - ctx::adjoindre.wait([this] + ctx::adjoindre.wait([this]() noexcept { return joined(); }); diff --git a/matrix/app.cc b/matrix/app.cc index 4f58efa50..10f36c00f 100644 --- a/matrix/app.cc +++ b/matrix/app.cc @@ -278,7 +278,7 @@ void ircd::m::app::worker() try { - child.dock.wait([this] + child.dock.wait([this]() noexcept { return child.pid >= 0; }); diff --git a/matrix/bridge.cc b/matrix/bridge.cc index 86e288e40..79e95d02e 100644 --- a/matrix/bridge.cc +++ b/matrix/bridge.cc @@ -195,8 +195,9 @@ bool ircd::m::bridge::config::exists(const string_view &id) { return get(std::nothrow, id, [] - (const auto &, const auto &, const auto &) + (const auto &, const auto &, const auto &) noexcept { + // no action }); } diff --git a/matrix/event.cc b/matrix/event.cc index a6fde39d6..70fb018e3 100644 --- a/matrix/event.cc +++ b/matrix/event.cc @@ -1076,7 +1076,7 @@ ircd::m::bad(const id::event &event_id) { bool ret {false}; index(std::nothrow, event_id, [&ret] - (const event::idx &event_idx) + (const event::idx &event_idx) noexcept { ret = event_idx == 0; }); diff --git a/matrix/event_prev.cc b/matrix/event_prev.cc index 02d6ca726..3a918178e 100644 --- a/matrix/event_prev.cc +++ b/matrix/event_prev.cc @@ -66,7 +66,8 @@ size_t ircd::m::count(const event::prev &prev) { size_t ret{0}; - m::for_each(prev, [&ret](const event::id &event_id) + m::for_each(prev, [&ret] + (const event::id &event_id) noexcept { ++ret; return true; diff --git a/matrix/event_refs.cc b/matrix/event_refs.cc index d18f1437b..fd88e2169 100644 --- a/matrix/event_refs.cc +++ b/matrix/event_refs.cc @@ -75,7 +75,7 @@ ircd::m::event::refs::rebuild() ++i; } - dock.wait([&i, &j] + dock.wait([&i, &j]() noexcept { return i == j; }); @@ -133,7 +133,7 @@ const { size_t ret(0); for_each(type, [&ret] - (const event::idx &, const dbs::ref &) + (const event::idx &, const dbs::ref &) noexcept { ++ret; return true; @@ -154,7 +154,7 @@ ircd::m::event::refs::has(const dbs::ref &type) const { return !for_each(type, [&type] - (const event::idx &, const dbs::ref &ref) + (const event::idx &, const dbs::ref &ref) noexcept { assert(ref == type); return false; @@ -167,7 +167,7 @@ ircd::m::event::refs::has(const dbs::ref &type, const { return !for_each(type, [&idx] - (const event::idx &ref, const dbs::ref &) + (const event::idx &ref, const dbs::ref &) noexcept { return ref != idx; // true to continue, false to break }); diff --git a/matrix/events.cc b/matrix/events.cc index 4554b1876..6ae006324 100644 --- a/matrix/events.cc +++ b/matrix/events.cc @@ -556,7 +556,7 @@ ircd::m::events::type::has(const string_view &type) { bool ret{false}; for_each(type, [&ret, &type] - (const string_view &type_) + (const string_view &type_) noexcept { ret = type == type_; return false; // uncond break out of loop after first result @@ -570,7 +570,7 @@ ircd::m::events::type::has_prefix(const string_view &type) { bool ret{false}; for_each(type, [&ret, &type] - (const string_view &type_) + (const string_view &type_) noexcept { ret = startswith(type_, type); return false; // uncond break out of loop after first result diff --git a/matrix/init_backfill.cc b/matrix/init_backfill.cc index d40ff15a3..fb4434501 100644 --- a/matrix/init_backfill.cc +++ b/matrix/init_backfill.cc @@ -129,7 +129,7 @@ ircd::m::init::backfill::worker_context; decltype(ircd::m::init::backfill::handle_quit) ircd::m::init::backfill::handle_quit { - run::level::QUIT, [] + run::level::QUIT, []() noexcept { term(); } diff --git a/matrix/keys.cc b/matrix/keys.cc index ffa28d137..e69552632 100644 --- a/matrix/keys.cc +++ b/matrix/keys.cc @@ -288,7 +288,7 @@ size_t ircd::m::keys::fetch(const queries &queries) { size_t ret(0); - get(queries, [&ret](const auto &) + get(queries, [&ret](const auto &) noexcept { ++ret; return true; diff --git a/matrix/push.cc b/matrix/push.cc index e69f8c0bf..6ed1c3d41 100644 --- a/matrix/push.cc +++ b/matrix/push.cc @@ -392,7 +392,7 @@ try }; power.for_each("notifications", [&required_level, &key] - (const auto &name, const auto &level) + (const auto &name, const auto &level) noexcept { if(name == key) { diff --git a/matrix/room.cc b/matrix/room.cc index 838c9db5b..86f4f3452 100644 --- a/matrix/room.cc +++ b/matrix/room.cc @@ -489,7 +489,11 @@ ircd::m::exists(const id::room_alias &room_alias, if(!remote_query) return false; - return room::aliases::cache::get(std::nothrow, room_alias, [](const room::id &room_id) {}); + return room::aliases::cache::get(std::nothrow, room_alias, [] + (const room::id &) noexcept + { + // no action + }); } int64_t @@ -1407,7 +1411,7 @@ const if(!match) column(byte_view(event_idx), std::nothrow, [&match, &type] - (const string_view &value) + (const string_view &value) noexcept { match = value == type; }); diff --git a/matrix/room_aliases.cc b/matrix/room_aliases.cc index bf185dcc9..813ec91bd 100644 --- a/matrix/room_aliases.cc +++ b/matrix/room_aliases.cc @@ -44,7 +44,8 @@ ircd::m::room::aliases::count(const string_view &server) const { size_t ret(0); - for_each(server, [&ret](const auto &a) + for_each(server, [&ret] + (const auto &a) noexcept { ++ret; return true; @@ -58,7 +59,7 @@ ircd::m::room::aliases::has(const alias &alias) const { return !for_each(alias.host(), [&alias] - (const id::room_alias &a) + (const id::room_alias &a) noexcept { assert(a.host() == alias.host()); return a == alias? false : true; // false to break on found diff --git a/matrix/room_auth.cc b/matrix/room_auth.cc index 59606471b..f05e8d3a0 100644 --- a/matrix/room_auth.cc +++ b/matrix/room_auth.cc @@ -660,28 +660,28 @@ ircd::m::room::auth::hookdata::hookdata(const m::event &event, } ,auth_create { - find([](const auto &event) + find([](const auto &event) noexcept { return json::get<"type"_>(event) == "m.room.create"; }) } ,auth_power { - find([](const auto &event) + find([](const auto &event) noexcept { return json::get<"type"_>(event) == "m.room.power_levels"; }) } ,auth_join_rules { - find([](const auto &event) + find([](const auto &event) noexcept { return json::get<"type"_>(event) == "m.room.join_rules"; }) } ,auth_member_target { - find([&event](const auto &auth_event) + find([&event](const auto &auth_event) noexcept { return json::get<"type"_>(auth_event) == "m.room.member" && json::get<"state_key"_>(auth_event) == json::get<"state_key"_>(event); @@ -689,7 +689,7 @@ ircd::m::room::auth::hookdata::hookdata(const m::event &event, } ,auth_member_sender { - find([&event](const auto &auth_event) + find([&event](const auto &auth_event) noexcept { return json::get<"type"_>(auth_event) == "m.room.member" && json::get<"state_key"_>(auth_event) == json::get<"sender"_>(event); @@ -725,7 +725,8 @@ ircd::m::room::auth::refs::count(const string_view &type) const { size_t ret(0); - for_each(type, [&ret](const auto &) + for_each(type, [&ret] + (const auto &) noexcept { ++ret; return true; @@ -738,7 +739,8 @@ bool ircd::m::room::auth::refs::has(const event::idx &idx) const { - return !for_each([&idx](const event::idx &ref) + return !for_each([&idx] + (const event::idx &ref) noexcept { return ref != idx; // true to continue, false to break }); @@ -749,7 +751,8 @@ ircd::m::room::auth::refs::has(const string_view &type) const { bool ret{false}; - for_each(type, [&ret](const auto &) + for_each(type, [&ret] + (const auto &) noexcept { ret = true; return false; @@ -782,7 +785,7 @@ const bool match; const auto matcher { - [&type, &match](const string_view &type_) + [&type, &match](const string_view &type_) noexcept { match = type == type_; } @@ -814,7 +817,8 @@ ircd::m::room::auth::chain::depth() const { size_t ret(0); - for_each([&ret](const auto &) + for_each([&ret] + (const auto &) noexcept { ++ret; return true; @@ -832,7 +836,7 @@ const (const auto &idx) { m::get(std::nothrow, idx, "type", [&type, &ret] - (const auto &value) + (const auto &value) noexcept { ret = value == type; }); diff --git a/matrix/room_events.cc b/matrix/room_events.cc index a888226f7..5e8be093a 100644 --- a/matrix/room_events.cc +++ b/matrix/room_events.cc @@ -56,7 +56,7 @@ ircd::m::twain(const room &room) }; s.rfor_each([&ret] - (const auto &range, const auto &event_idx) + (const auto &range, const auto &event_idx) noexcept { ret.first = range.first - 1; return false; @@ -79,7 +79,7 @@ ircd::m::sounding(const room &room) }; s.rfor_each([&ret] - (const auto &range, const auto &event_idx) + (const auto &range, const auto &event_idx) noexcept { ret.first = range.second; ret.second = event_idx; @@ -103,7 +103,7 @@ ircd::m::hazard(const room &room) }; s.for_each([&ret] - (const auto &range, const auto &event_idx) + (const auto &range, const auto &event_idx) noexcept { ret.first = range.first; return false; @@ -438,7 +438,7 @@ const { size_t ret{0}; for_each([&ret] - (const auto &event_id, const auto &depth, const auto &event_idx) + (const auto &event_id, const auto &depth, const auto &event_idx) noexcept { ++ret; return true; @@ -662,7 +662,7 @@ const { size_t ret{0}; for_each([&ret] - (const auto &event_id, const auto &depth, const auto &event_idx) + (const auto &event_id, const auto &depth, const auto &event_idx) noexcept { ++ret; return true; @@ -677,7 +677,7 @@ const { const std::function in_room { - [this](const string_view &room_id) + [this](const string_view &room_id) noexcept { return room_id == this->room.room_id; } diff --git a/matrix/room_head.cc b/matrix/room_head.cc index ee00567de..9033d7370 100644 --- a/matrix/room_head.cc +++ b/matrix/room_head.cc @@ -225,7 +225,7 @@ const { size_t ret(0); for_each([&ret] - (const event::idx &event_idx, const event::id &event_id) + (const event::idx &event_idx, const event::id &event_id) noexcept { ++ret; return true; @@ -240,7 +240,7 @@ const { bool ret{false}; for_each([&ret, &event_id] - (const event::idx &event_idx, const event::id &event_id_) + (const event::idx &event_idx, const event::id &event_id_) noexcept { ret = event_id_ == event_id; return !ret; // for_each protocol: false to break diff --git a/matrix/room_members.cc b/matrix/room_members.cc index 66bd8fd7a..78dfe63de 100644 --- a/matrix/room_members.cc +++ b/matrix/room_members.cc @@ -28,7 +28,7 @@ ircd::m::room::members::empty(const string_view &membership, const { return for_each(membership, host, closure{[] - (const user::id &user_id) + (const user::id &user_id) noexcept { return false; }}); @@ -55,7 +55,7 @@ const { size_t ret{0}; for_each(membership, host, closure{[&ret] - (const user::id &user_id) + (const user::id &user_id) noexcept { ++ret; return true; diff --git a/matrix/room_origins.cc b/matrix/room_origins.cc index 481e01ea3..848e0d3d9 100644 --- a/matrix/room_origins.cc +++ b/matrix/room_origins.cc @@ -90,7 +90,7 @@ ircd::m::room::origins::empty() const { return for_each(closure_bool{[] - (const string_view &) + (const string_view &) noexcept { // return false to break and return false. return false; @@ -102,7 +102,8 @@ ircd::m::room::origins::count() const { size_t ret{0}; - for_each([&ret](const string_view &) + for_each([&ret] + (const string_view &) noexcept { ++ret; }); @@ -150,7 +151,7 @@ const { ushort ret{2}; for_each(closure_bool{[&ret, &origin] - (const string_view &origin_) -> bool + (const string_view &origin_) noexcept -> bool { if(origin == origin_) ret = 1; diff --git a/matrix/room_power.cc b/matrix/room_power.cc index fba0ba391..c4cc1fcce 100644 --- a/matrix/room_power.cc +++ b/matrix/room_power.cc @@ -551,7 +551,7 @@ const { size_t ret{0}; for_each([&ret] - (const string_view &, const int64_t &) + (const string_view &, const int64_t &) noexcept { ++ret; return true; @@ -581,7 +581,7 @@ const { size_t ret{0}; for_each(prop, [&ret] - (const string_view &, const int64_t &) + (const string_view &, const int64_t &) noexcept { ++ret; return true; diff --git a/matrix/room_server_acl.cc b/matrix/room_server_acl.cc index d9790dd2d..dc87e8aed 100644 --- a/matrix/room_server_acl.cc +++ b/matrix/room_server_acl.cc @@ -173,7 +173,7 @@ const }; return !for_each(prop, [&server] - (const string_view &expression) + (const string_view &expression) noexcept { const globular_imatch match { @@ -191,7 +191,7 @@ ircd::m::room::server_acl::has(const string_view &prop, const { return !for_each(prop, [&expr] - (const string_view &_expr) + (const string_view &_expr) noexcept { // false to break on match return _expr == expr? false : true; @@ -240,7 +240,7 @@ const { size_t ret(0); for_each(prop, [&ret] - (const string_view &) + (const string_view &) noexcept { ++ret; return true; diff --git a/matrix/room_state.cc b/matrix/room_state.cc index ccc3876bd..f4a139948 100644 --- a/matrix/room_state.cc +++ b/matrix/room_state.cc @@ -85,7 +85,7 @@ const { event::idx ret; get(type, state_key, event::closure_idx{[&ret] - (const event::idx &event_idx) + (const event::idx &event_idx) noexcept { ret = event_idx; }}); @@ -101,7 +101,7 @@ const { event::idx ret{0}; get(std::nothrow, type, state_key, event::closure_idx{[&ret] - (const event::idx &event_idx) + (const event::idx &event_idx) noexcept { ret = event_idx; }}); @@ -295,7 +295,7 @@ const } return !for_each(type, [] - (const string_view &, const string_view &, const event::idx &) + (const string_view &, const string_view &, const event::idx &) noexcept { return false; }); @@ -366,7 +366,7 @@ const size_t ret(0); for_each(type, [&ret] - (const string_view &, const string_view &, const event::idx &) + (const string_view &, const string_view &, const event::idx &) noexcept { ++ret; return true; @@ -755,7 +755,7 @@ ircd::m::room::state::is(const event::idx &event_idx) { bool ret{false}; m::get(event_idx, "state_key", [&ret] - (const string_view &state_key) + (const string_view &state_key) noexcept { ret = true; }); @@ -769,7 +769,7 @@ ircd::m::room::state::is(std::nothrow_t, { bool ret{false}; m::get(std::nothrow, event_idx, "state_key", [&ret] - (const string_view &state_key) + (const string_view &state_key) noexcept { ret = true; }); @@ -797,7 +797,8 @@ ircd::m::room::state::purge_replaced(const room::id &room_id) for(; it; ++it) { const m::event::idx &event_idx(it.event_idx()); - if(!m::get(std::nothrow, event_idx, "state_key", [](const auto &) {})) + static const auto no_action{[](const auto &) noexcept {}}; + if(!m::get(std::nothrow, event_idx, "state_key", no_action)) continue; if(!m::event::refs(event_idx).count(m::dbs::ref::NEXT_STATE)) @@ -846,7 +847,7 @@ ircd::m::room::state::prev(const event::idx &event_idx) { event::idx ret{0}; prev(event_idx, [&ret] - (const event::idx &event_idx) + (const event::idx &event_idx) noexcept { if(event_idx > ret) ret = event_idx; @@ -862,7 +863,7 @@ ircd::m::room::state::next(const event::idx &event_idx) { event::idx ret{0}; next(event_idx, [&ret] - (const event::idx &event_idx) + (const event::idx &event_idx) noexcept { if(event_idx > ret) ret = event_idx; diff --git a/matrix/room_state_history.cc b/matrix/room_state_history.cc index 02832948b..605366244 100644 --- a/matrix/room_state_history.cc +++ b/matrix/room_state_history.cc @@ -102,7 +102,7 @@ const event::idx ret{0}; assert(type && defined(state_key)); for_each(type, state_key, [&ret] - (const auto &, const auto &, const auto &, const auto &event_idx) + (const auto &, const auto &, const auto &, const auto &event_idx) noexcept { ret = event_idx; return false; @@ -124,7 +124,7 @@ ircd::m::room::state::history::has(const string_view &type, const { return !for_each(type, state_key, [] - (const auto &type, const auto &state_key, const auto &depth, const auto &event_idx) + (const auto &, const auto &, const auto &, const auto &) noexcept { return false; }); @@ -144,7 +144,7 @@ const { size_t ret(0); for_each(type, state_key, [&ret] - (const auto &type, const auto &state_key, const auto &depth, const auto &event_idx) + (const auto &, const auto &, const auto &, const auto &) noexcept { ++ret; return true; diff --git a/matrix/room_state_space.cc b/matrix/room_state_space.cc index 338ebc35f..8dbb509a9 100644 --- a/matrix/room_state_space.cc +++ b/matrix/room_state_space.cc @@ -73,7 +73,7 @@ ircd::m::room::state::space::has(const string_view &type, const { return !for_each(type, state_key, depth, [] - (const auto &type, const auto &state_key, const auto &depth, const auto &event_idx) + (const auto &, const auto &, const auto &, const auto &) noexcept { return false; }); @@ -109,7 +109,7 @@ const { size_t ret(0); for_each(type, state_key, depth, [&ret] - (const auto &type, const auto &state_key, const auto &depth, const auto &event_idx) + (const auto &, const auto &, const auto &, const auto &) noexcept { ++ret; return true; diff --git a/matrix/room_type.cc b/matrix/room_type.cc index b1298716d..987a2fc13 100644 --- a/matrix/room_type.cc +++ b/matrix/room_type.cc @@ -34,7 +34,7 @@ ircd::m::room::type::empty() const { return for_each([] - (const auto &type, const auto &depth, const auto &event_idx) + (const auto &type, const auto &depth, const auto &event_idx) noexcept { return false; }); @@ -46,7 +46,7 @@ const { size_t ret(0); for_each([&ret] - (const auto &type, const auto &depth, const auto &event_idx) + (const auto &type, const auto &depth, const auto &event_idx) noexcept { ++ret; return true; diff --git a/matrix/rooms.cc b/matrix/rooms.cc index f5de7fcdb..44b34cc0f 100644 --- a/matrix/rooms.cc +++ b/matrix/rooms.cc @@ -64,7 +64,7 @@ bool ircd::m::rooms::has(const opts &opts) { return !for_each(opts, [] - (const m::room::id &) + (const m::room::id &) noexcept { // false to break; for_each() returns false return false; @@ -76,7 +76,7 @@ ircd::m::rooms::count(const opts &opts) { size_t ret{0}; for_each(opts, [&ret] - (const m::room::id &) + (const m::room::id &) noexcept { ++ret; return true; @@ -216,7 +216,7 @@ ircd::m::rooms::for_each(const opts &opts, { ++prefetch; prefetched += m::prefetch(event_idx, "room_id"); - dock.wait([&] + dock.wait([&]() noexcept { return fetch + opts.prefetch > prefetch; }); diff --git a/matrix/sync.cc b/matrix/sync.cc index 069650f26..cd6b7d24f 100644 --- a/matrix/sync.cc +++ b/matrix/sync.cc @@ -461,7 +461,7 @@ const { size_t ret(0); sync::for_each(this->name(), [&ret] - (auto &item) + (auto &item) noexcept { ++ret; return true; diff --git a/matrix/txn.cc b/matrix/txn.cc index 2644b9e73..1451569ec 100644 --- a/matrix/txn.cc +++ b/matrix/txn.cc @@ -89,7 +89,7 @@ ircd::m::txn::create(const closure &closure, { iov, !empty(pdu), { - "pdus", [&pdu]() -> json::value + "pdus", [&pdu]() noexcept -> json::value { return { data(pdu), size(pdu) }; } @@ -100,7 +100,7 @@ ircd::m::txn::create(const closure &closure, { iov, !empty(edu), { - "edus", [&edu]() -> json::value + "edus", [&edu]() noexcept -> json::value { return { data(edu), size(edu) }; } @@ -111,7 +111,7 @@ ircd::m::txn::create(const closure &closure, { iov, !empty(pdu_failure), { - "pdu_failures", [&pdu_failure]() -> json::value + "pdu_failures", [&pdu_failure]() noexcept -> json::value { return { data(pdu_failure), size(pdu_failure) }; } diff --git a/matrix/user_devices.cc b/matrix/user_devices.cc index ccefb733e..359b31d34 100644 --- a/matrix/user_devices.cc +++ b/matrix/user_devices.cc @@ -237,7 +237,7 @@ const const bool got { get(std::nothrow, id, prop, [&val, &dup] - (const auto &event_idx, const json::string &existing) + (const auto &event_idx, const json::string &existing) noexcept { dup = val == existing; }) @@ -293,7 +293,7 @@ const { bool ret{false}; get(std::nothrow, id, prop, [&ret] - (const auto &event_idx, const string_view &value) + (const auto &event_idx, const string_view &value) noexcept { ret = !empty(value); }); diff --git a/matrix/user_events.cc b/matrix/user_events.cc index 29adabb9c..475f86bce 100644 --- a/matrix/user_events.cc +++ b/matrix/user_events.cc @@ -13,7 +13,7 @@ ircd::m::user::events::count() const { size_t ret{0}; - for_each([&ret](const event::idx &) + for_each([&ret](const event::idx &) noexcept { ++ret; return true; diff --git a/matrix/user_ignores.cc b/matrix/user_ignores.cc index 055601b92..42f0da201 100644 --- a/matrix/user_ignores.cc +++ b/matrix/user_ignores.cc @@ -33,7 +33,7 @@ ircd::m::user::ignores::has(const m::user::id &other) const { return !for_each([&other] - (const m::user::id &user_id, const json::object &) + (const m::user::id &user_id, const json::object &) noexcept { return user_id != other; }); diff --git a/matrix/user_mitsein.cc b/matrix/user_mitsein.cc index b068aa275..b614afbb5 100644 --- a/matrix/user_mitsein.cc +++ b/matrix/user_mitsein.cc @@ -15,7 +15,7 @@ const { // Return true if broken out of loop. return !for_each(other, membership, [] - (const m::room &, const string_view &) + (const m::room &, const string_view &) noexcept { // Break out of loop at first shared room return false; @@ -27,7 +27,8 @@ ircd::m::user::mitsein::count(const string_view &membership) const { size_t ret{0}; - for_each(membership, [&ret](const m::user &) + for_each(membership, [&ret] + (const m::user &) noexcept { ++ret; return true; @@ -42,7 +43,8 @@ ircd::m::user::mitsein::count(const m::user &user, const { size_t ret{0}; - for_each(user, membership, [&ret](const m::room &, const string_view &) + for_each(user, membership, [&ret] + (const m::room &, const string_view &) noexcept { ++ret; return true; diff --git a/matrix/user_notifications.cc b/matrix/user_notifications.cc index f4af8b00c..926777c5f 100644 --- a/matrix/user_notifications.cc +++ b/matrix/user_notifications.cc @@ -58,7 +58,7 @@ ircd::m::user::notifications::empty(const opts &opts) const { return !for_each(opts, closure_meta{[&] - (const auto &, const auto &) + (const auto &, const auto &) noexcept { return false; }}); @@ -70,7 +70,7 @@ const { size_t ret(0); for_each(opts, closure_meta{[&ret] - (const auto &, const auto &) + (const auto &, const auto &) noexcept { ++ret; return true; diff --git a/matrix/user_profile.cc b/matrix/user_profile.cc index 4f44d7477..ef4dcc37d 100644 --- a/matrix/user_profile.cc +++ b/matrix/user_profile.cc @@ -152,7 +152,7 @@ ircd::m::user::profile::fetch(const m::user &user, { bool exists{false}; profile.get(std::nothrow, member.first, [&exists, &member] - (const string_view &key, const string_view &val) + (const string_view &key, const string_view &val) noexcept { exists = member.second == val; }); diff --git a/matrix/user_pushers.cc b/matrix/user_pushers.cc index 267b6fb32..039efa985 100644 --- a/matrix/user_pushers.cc +++ b/matrix/user_pushers.cc @@ -125,7 +125,8 @@ ircd::m::user::pushers::has(const string_view &key) const { return !for_each([&key] // for_each() returns true if no match - (const event::idx &pusher_idx, const string_view &pushkey, const push::pusher &pusher) + (const event::idx &, const string_view &pushkey, const push::pusher &) + noexcept { return key != pushkey; }); @@ -136,7 +137,8 @@ ircd::m::user::pushers::any(const string_view &kind) const { return !for_each([&kind] // for_each() returns true if no match - (const event::idx &pusher_idx, const string_view &pushkey, const push::pusher &pusher) + (const event::idx &, const string_view &, const push::pusher &pusher) + noexcept { if(!kind) return false; @@ -154,7 +156,8 @@ const { size_t ret{0}; for_each([&ret, &kind] - (const event::idx &pusher_idx, const string_view &pushkey, const push::pusher &pusher) + (const event::idx &, const string_view &, const push::pusher &pusher) + noexcept { ret += !kind || json::get<"kind"_>(pusher) == kind; return true; diff --git a/matrix/user_rooms.cc b/matrix/user_rooms.cc index 2ddcf1788..0cf666ad0 100644 --- a/matrix/user_rooms.cc +++ b/matrix/user_rooms.cc @@ -14,7 +14,7 @@ const { size_t ret{0}; for_each([&ret] - (const m::room &, const string_view &membership) + (const m::room &, const string_view &membership) noexcept { ++ret; }); @@ -28,7 +28,7 @@ const { size_t ret{0}; for_each(membership, [&ret] - (const m::room &, const string_view &membership) + (const m::room &, const string_view &membership) noexcept { ++ret; }); diff --git a/matrix/users.cc b/matrix/users.cc index 039b140f4..d0f77c8e3 100644 --- a/matrix/users.cc +++ b/matrix/users.cc @@ -21,7 +21,7 @@ bool ircd::m::users::exists(const opts &opts) { return !for_each(opts, [] - (const auto &) + (const auto &) noexcept { // return false to break and have for_each() returns false return false; @@ -32,7 +32,8 @@ size_t ircd::m::users::count(const opts &opts) { size_t ret(0); - for_each(opts, [&ret](const auto &) + for_each(opts, [&ret] + (const auto &) noexcept { ++ret; return true; diff --git a/matrix/users_servers.cc b/matrix/users_servers.cc index a4fd12a9e..d7fc974ea 100644 --- a/matrix/users_servers.cc +++ b/matrix/users_servers.cc @@ -15,7 +15,7 @@ const { // Return true if broken out of loop. return !for_each(membership, [] - (const auto &server) + (const auto &server) noexcept { // Break out of loop at first shared room return false; @@ -28,7 +28,7 @@ const { size_t ret{0}; for_each(membership, [&ret] - (const auto &server) + (const auto &server) noexcept { ++ret; return true;