1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 16:06:38 +02:00

Clean up some session code in the SASL module.

This commit is contained in:
Sadie Powell
2025-02-20 21:18:48 +00:00
parent 0c193f8149
commit 8da52bf121
+9 -9
View File
@@ -164,7 +164,8 @@ class SASLService final
: public SASL::Service
, public Timer
{
std::map<Anope::string, SASL::Session *> sessions;
private:
Anope::map<SASL::Session *> sessions;
public:
SASLService(Module *o)
@@ -337,17 +338,16 @@ public:
void Tick() override
{
for (std::map<Anope::string, Session *>::iterator it = sessions.begin(); it != sessions.end();)
for (auto it = sessions.begin(); it != sessions.end(); )
{
Anope::string key = it->first;
Session *s = it->second;
++it;
if (!s || s->created + 60 < Anope::CurTime)
const auto *sess = it->second;
if (!sess || sess->created + 60 < Anope::CurTime)
{
delete s;
sessions.erase(key);
delete sess;
it = sessions.erase(it);
}
else
it++;
}
}
};