0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 14:38:57 +02:00

ircd:Ⓜ️🪝 Minor fixes for hook unmapper.

This commit is contained in:
Jason Volk 2018-10-07 18:55:29 -07:00
parent f369af944b
commit f68926e526

View file

@ -3079,18 +3079,16 @@ ircd::m::hook::maps::del(base &hook,
{
size_t ret{0};
const auto unmap{[&hook, &ret]
(auto &map, const string_view &key)
(auto &map, const string_view &value)
{
auto pit{map.equal_range(key)};
for(; pit.first != pit.second; ++pit.first)
auto pit{map.equal_range(value)};
while(pit.first != pit.second)
if(pit.first->second == &hook)
{
pit.first = map.erase(pit.first);
++ret;
return map.erase(pit.first);
}
assert(0);
return end(map);
else ++pit.first;
}};
// Unconditional attempt to remove from always.