]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix the operator== for irc::string -> std::string to be const&, the lack of const...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 10 Mar 2007 15:29:47 +0000 (15:29 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 10 Mar 2007 15:29:47 +0000 (15:29 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6643 e03df62e-2008-0410-955e-edbf42e46eb7

include/hashcomp.h
include/u_listmode.h
src/hashcomp.cpp

index 323b35980b24dfa331a53e4d5f76ee8b7bc6796f..79c7627a0c5acb238e183e2361382b332db3f43c 100644 (file)
@@ -530,8 +530,8 @@ std::istream& operator>>(std::istream &is, irc::string &str);
  */
 std::string operator+ (std::string& leftval, irc::string& rightval);
 irc::string operator+ (irc::string& leftval, std::string& rightval);
-bool operator== (std::string& leftval, irc::string& rightval);
-bool operator== (irc::string& leftval, std::string& rightval);
+bool operator== (const std::string& leftval, const irc::string& rightval);
+bool operator== (const irc::string& leftval, const std::string& rightval);
 
 std::string assign(const irc::string &other);
 irc::string assign(const std::string &other);
index d5770d9b746e2902498b9473d28af88dadaf1abc..ce720f9261c67e05e6c68bf54e77fb7821a8aed8 100644 (file)
@@ -102,12 +102,11 @@ class ListModeBase : public ModeHandler
        {
                modelist* el;
                channel->GetExt(infokey, el);
-               irc::string csp(assign(parameter));
                if (el)
                {
                        for (modelist::iterator it = el->begin(); it != el->end(); it++)
                        {
-                               if(csp == it->mask)
+                               if(parameter == it->mask)
                                {
                                        return std::make_pair(true, parameter);
                                }
index 53483c7480f0322b078d7aed905648097b73b3ec..b78b66af6746de7ff4f4648e8dd95bcf669a3bad 100644 (file)
@@ -148,12 +148,12 @@ irc::string operator+ (irc::string& leftval, std::string& rightval)
        return leftval + irc::string(rightval.c_str());
 }
 
-bool operator== (std::string& leftval, irc::string& rightval)
+bool operator== (const std::string& leftval, const irc::string& rightval)
 {
        return (leftval.c_str() == rightval);
 }
 
-bool operator== (irc::string& leftval, std::string& rightval)
+bool operator== (const irc::string& leftval, const std::string& rightval)
 {
        return (leftval == rightval.c_str());
 }