summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-16 00:44:20 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-16 00:44:20 +0000
commit49b81e83328aedaa7d380f0f9413ce4fb3516578 (patch)
tree067363b70b8a72927a7a6bc3225a17a01373f168
parent7c59b25d64cbaba917890f05e466d52a31272809 (diff)
Optimise caps loop making it real neat. Thx Brain.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6682 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_blockcaps.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index 1d9ea70a0..e984087d8 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -89,10 +89,7 @@ public:
{
int caps = 0;
for (std::string::iterator i = text.begin(); i != text.end(); i++)
- {
- if (capsmap[(unsigned char)*i])
- caps++;
- }
+ caps += capsmap[(unsigned char)*i];
if ( ((caps*100)/(int)text.length()) >= percent )
{
user->WriteServ( "404 %s %s :Your line cannot be more than %d%% capital letters if it is %d or more letters long", user->nick, c->name, percent, minlen);