]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Replace #defines with references in DoCollision()
authorAttila Molnar <attilamolnar@hush.com>
Sat, 26 Jul 2014 13:51:28 +0000 (15:51 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 26 Jul 2014 13:51:28 +0000 (15:51 +0200)
src/modules/m_spanningtree/nickcollide.cpp

index 3b5944e9f92b475521de0aa2a2c9efedb00e74ae..2e840c6b82cfe852cdda48ddb574f9684fb354f0 100644 (file)
@@ -57,16 +57,14 @@ int SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remot
        bool bChangeLocal = true;
        bool bChangeRemote = true;
 
-       /* for brevity, don't use the User - use defines to avoid any copy */
-       #define localts u->age
-       #define localident u->ident
-       #define localip u->GetIPString()
-
        // If the timestamps are not equal only one of the users has to change nick,
        // otherwise both have to change
+       const time_t localts = u->age;
        if (remotets != localts)
        {
                /* first, let's see if ident@host matches. */
+               const std::string& localident = u->ident;
+               const std::string& localip = u->GetIPString();
                bool SamePerson = (localident == remoteident)
                                && (localip == remoteip);