summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-09 00:31:52 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-09 00:31:52 +0000
commit4d920e51882c4f61f0714b7785e0ca4463f549e1 (patch)
treed83b3ec3384c1aae2231fd60306c7d5eb8d6653d /src
parentbe70931a50f23c68e055602facce5736775f3fab (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp26
1 files changed, 11 insertions, 15 deletions
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;
}
}