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:
parent
f369af944b
commit
f68926e526
12
ircd/m/m.cc
12
ircd/m/m.cc
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue