]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove some unnecessary NULL checks
authorAttila Molnar <attilamolnar@hush.com>
Sat, 10 Jan 2015 14:36:13 +0000 (15:36 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 10 Jan 2015 14:36:13 +0000 (15:36 +0100)
src/inspsocket.cpp
src/modules/m_delayjoin.cpp
src/modules/m_delaymsg.cpp

index 886130f1bb556d894af729d6f782d46343ee255d..d3ee7538b6e70102b32fae654b8f883a711aaea2 100644 (file)
@@ -475,11 +475,8 @@ void BufferedSocket::DoWrite()
 BufferedSocket::~BufferedSocket()
 {
        this->Close();
-       if (Timeout)
-       {
-               // The timer is removed from the TimerManager in Timer::~Timer()
-               delete Timeout;
-       }
+       // The timer is removed from the TimerManager in Timer::~Timer()
+       delete Timeout;
 }
 
 void StreamSocket::HandleEvent(EventType et, int errornum)
index 2474cd6ad21c8146ac7b060d3f3c691e555b4ae4..7e800572ef0ed4bb59ff4d1901178fe73cc2e51b 100644 (file)
@@ -138,10 +138,6 @@ void ModuleDelayJoin::OnBuildNeighborList(User* source, IncludeChanList& include
 
 void ModuleDelayJoin::OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list)
 {
-       /* Server origin */
-       if (!user)
-               return;
-
        if (target_type != TYPE_CHANNEL)
                return;
 
@@ -165,7 +161,7 @@ void ModuleDelayJoin::OnText(User* user, void* dest, int target_type, const std:
 /* make the user visible if he receives any mode change */
 ModResult ModuleDelayJoin::OnRawMode(User* user, Channel* channel, ModeHandler* mh, const std::string& param, bool adding)
 {
-       if (!user || !channel || param.empty())
+       if (!channel || param.empty())
                return MOD_RES_PASSTHRU;
 
        // If not a prefix mode then we got nothing to do here
index c906e2c3064d5f2566182067f7a83a001471cdc7..32a0ba96ee03d9bdba01e44167fae735482d3fe6 100644 (file)
@@ -95,8 +95,7 @@ void ModuleDelayMsg::OnUserJoin(Membership* memb, bool sync, bool created, CULis
 
 ModResult ModuleDelayMsg::OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype)
 {
-       /* Server origin */
-       if ((!user) || (!IS_LOCAL(user)))
+       if (!IS_LOCAL(user))
                return MOD_RES_PASSTHRU;
 
        if ((target_type != TYPE_CHANNEL) || ((!allownotice) && (msgtype == MSG_NOTICE)))