summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 22:35:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 22:35:02 +0000
commit98562fe7b8b715d90bdb4288e764823a39b51f21 (patch)
treeb7d0d2b38ca78a94e372030ad31c414f09da780a /src
parent16abfa95be7d158930206be7bc06878076441392 (diff)
Save ourselves 3 dereferences
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4155 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 35003de0e..5df98d23b 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -423,12 +423,14 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server
int handler_id = 0;
int parameter_counter = 2; /* Index of first parameter */
- for (std::string::const_iterator modeletter = mode_sequence.begin(); modeletter != mode_sequence.end(); modeletter++)
+ for (std::string::const_iterator letter = mode_sequence.begin(); letter != mode_sequence.end(); letter++)
{
- switch (*modeletter)
+ unsigned char modechar = *letter;
+
+ switch (modechar)
{
- log(DEBUG,"Iterate mode letter %c",*modeletter);
+ log(DEBUG,"Iterate mode letter %c",modechar);
/* NB:
* For + and - mode characters, we don't just stick the character into the output sequence.
@@ -463,13 +465,13 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server
* a user mode. This is a little stranger, but a lot
* faster, than using a map of pairs.
*/
- handler_id = (*modeletter - 65) | mask;
+ handler_id = (modechar - 65) | mask;
if (modehandlers[handler_id])
{
bool abort = false;
- log(DEBUG,"Found a ModeHandler* for mode %c",*modeletter);
+ log(DEBUG,"Found a ModeHandler* for mode %c",modechar);
for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
{
@@ -518,7 +520,7 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server
}
/* Add the mode letter */
- output_sequence = output_sequence + *modeletter;
+ output_sequence.push_back(modechar);
log(DEBUG,"Added mode letter to output sequence, sequence now: '%s'",output_sequence.c_str());
/* Is there a valid parameter for this mode? If so add it to the parameter list */