From 4d920e51882c4f61f0714b7785e0ca4463f549e1 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 9 Jan 2007 00:31:52 +0000 Subject: 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 --- src/channels.cpp | 26 +++++++++++--------------- 1 file 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; } } -- cgit v1.2.3