From d396355d3e594544a4760f3e7d4e7c75a02430a8 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 5 Jun 2007 16:49:06 +0000 Subject: Refactored InspIRCd::Duration(). The leetcode now lives! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7237 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/command_parse.h | 22 +++++++++++++++++++++- include/inspircd.h | 20 -------------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/command_parse.h b/include/command_parse.h index 2ffb30ee6..6d98af97c 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -205,6 +205,26 @@ class cmd_reload : public command_t CmdResult Handle(const char** parameters, int pcnt, userrec *user); }; - +const int duration_multi[] = +{ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 86400, 1, 1, 1, 3600, + 1, 1, 1, 1, 60, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 604800, 1, 31536000, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 86400, 1, 1, 1, 3600, 1, 1, 1, 1, 60, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 604800, 1, 31536000, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +}; #endif diff --git a/include/inspircd.h b/include/inspircd.h index 505fa1034..de6e93c0c 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -396,26 +396,6 @@ class CoreExport InspIRCd : public classbase */ char ReadBuffer[65535]; - /** Number of seconds in a minute - */ - const long duration_m; - - /** Number of seconds in an hour - */ - const long duration_h; - - /** Number of seconds in a day - */ - const long duration_d; - - /** Number of seconds in a week - */ - const long duration_w; - - /** Number of seconds in a year - */ - const long duration_y; - /** Used when connecting clients */ insp_sockaddr client, server; -- cgit v1.2.3