From 69112caf3ae0230ba4538bbbae6d8f0579afd5a4 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 26 Nov 2006 19:03:16 +0000 Subject: Tidyup, avoid ternary if() on every iteration of a loop (bad brain bad) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5811 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_silence_ext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_silence_ext.cpp b/src/modules/m_silence_ext.cpp index e3f8826e9..4c92b3a47 100644 --- a/src/modules/m_silence_ext.cpp +++ b/src/modules/m_silence_ext.cpp @@ -286,6 +286,8 @@ class ModuleSilence : public Module else if (target_type == TYPE_CHANNEL) { chanrec* chan = (chanrec*)dest; + int public_silence = (silence_type == SILENCE_PRIVATE ? SILENCE_CHANNEL : SILENCE_CNOTICE); + if (chan) { CUList *ulist; @@ -309,7 +311,7 @@ class ModuleSilence : public Module { if ((IS_LOCAL(i->second)) && (user != i->second)) { - if (MatchPattern(i->second, user, silence_type == SILENCE_PRIVATE ? SILENCE_CHANNEL : SILENCE_CNOTICE) == 1) + if (MatchPattern(i->second, user, public_silence) == 1) { exempt_list[i->second] = i->second; } -- cgit v1.2.3