diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-20 16:07:02 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-20 16:07:02 +0000 |
commit | 08dc6b94f774f8f836354c8ac1c1945ddf35ad48 (patch) | |
tree | 0ba7321f28a9d88f52b3924b2ddba5bc39c610f9 /src | |
parent | e895332dff10f1bc4420fb60023834a049a5a08f (diff) |
Better way even than suggested.
We need one counter, nonlistmodes_found, and start with it at 0. In the while loop, if we find any modes that arent of list mode type we inc the counter,
and if the counter is zero after the end of the loop, we can just return (we processed everything already and nothing is left)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6401 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 5e9dc1233..a7effa642 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -282,6 +282,7 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool if ((targetchannel) && (pcnt == 2)) { const char* mode = parameters[1]; + int nonlistmodes_found = 0; mask = MASK_CHANNEL; @@ -313,9 +314,15 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool if (display) mh->DisplayList(user, targetchannel); } + else + nonlistmodes_found++; mode++; } + + /* We didnt have any modes that were non-list, we can return here */ + if (!nonlistmodes_found) + return; } if (pcnt == 1) |