1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 17:56:37 +02:00

Added Anope::CurTime to keep us from calling time() everywhere

This commit is contained in:
Adam
2010-09-10 20:31:31 -04:00
parent 9eb7562bee
commit f00e76d30a
64 changed files with 224 additions and 240 deletions
+2 -4
View File
@@ -144,7 +144,7 @@ XLine::XLine(const Anope::string &mask, const Anope::string &reason) : Mask(mask
{
}
XLine::XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason) : Mask(mask), By(by), Created(time(NULL)), Expires(expires), Reason(reason)
XLine::XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason) : Mask(mask), By(by), Created(Anope::CurTime), Expires(expires), Reason(reason)
{
}
@@ -405,13 +405,11 @@ XLine *XLineManager::HasEntry(const Anope::string &mask)
*/
XLine *XLineManager::Check(User *u)
{
const time_t now = time(NULL);
for (unsigned i = this->XLines.size(); i > 0; --i)
{
XLine *x = this->XLines[i - 1];
if (x->Expires && x->Expires < now)
if (x->Expires && x->Expires < Anope::CurTime)
{
OnExpire(x);
delete x;