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:
+9
-9
@@ -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++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user