]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Tidy up an if/then/else chain into a switch
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 9 Jan 2007 00:31:52 +0000 (00:31 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Tue, 9 Jan 2007 00:31:52 +0000 (00:31 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6268 e03df62e-2008-0410-955e-edbf42e46eb7

src/channels.cpp

index 4b1bc530914c8c37e9238bb397b978f1f2406d33..21af2717750199b6b80c45ff7b7aeb60627c4b26 100644 (file)
@@ -70,22 +70,18 @@ bool chanrec::IsModeSet(char mode)
 
 std::string chanrec::GetModeParameter(char mode)
 {
-       if (mode == 'k')
+       switch (mode)
        {
-               return this->key;
-       }
-       else if (mode == 'l')
-       {
-               return ConvToStr(this->limit);
-       }
-       else
-       {
-               CustomModeList::iterator n = custom_mode_params.find(mode);
-               if (n != custom_mode_params.end())
-               {
-                       return n->second;
-               }
-               return "";
+               case 'k':
+                       return this->key;
+               case 'l':
+                       return ConvToStr(this->limit);
+               default:
+                       CustomModeList::iterator n = custom_mode_params.find(mode);
+                       if (n != custom_mode_params.end())
+                               return n->second;
+                       return "";
+               break;
        }
 }