From: brain Date: Tue, 9 Jan 2007 00:31:52 +0000 (+0000) Subject: Tidy up an if/then/else chain into a switch X-Git-Tag: v2.0.23~6118 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=4d920e51882c4f61f0714b7785e0ca4463f549e1;p=user%2Fhenk%2Fcode%2Finspircd.git Tidy up an if/then/else chain into a switch git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6268 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/channels.cpp b/src/channels.cpp index 4b1bc5309..21af27177 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -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; } }