Remove unnecessary duplicated NULL tests in handle_server_stats()

Also make handle_server_stats() static.
This commit is contained in:
Kevin Easton
2017-06-08 23:17:06 +10:00
parent 529b1e0aa0
commit 60dc1afdca

View File

@@ -393,7 +393,7 @@ static long divide_rounded(double a, double b)
return b != 0.0 ? (long)round(a / b) : 0; return b != 0.0 ? (long)round(a / b) : 0;
} }
int handle_server_stats(char *from, char **ArgList, int comm) static int handle_server_stats(char *from, char **ArgList, int comm)
{ {
static int norm = 0, static int norm = 0,
invisible = 0, invisible = 0,
@@ -408,6 +408,8 @@ static int norm = 0,
int ret = 1; int ret = 1;
char *line; char *line;
/* ArgList[0] has been verified non-NULL by the caller. */
line = LOCAL_COPY(ArgList[0]); line = LOCAL_COPY(ArgList[0]);
switch(comm) switch(comm)
{ {
@@ -425,17 +427,13 @@ static int norm = 0,
} }
break; break;
case 252: /* number of ircops */ case 252: /* number of ircops */
if (ArgList[0]) ircops = my_atol(ArgList[0]);
ircops = my_atol(ArgList[0]);
break; break;
case 253: /* number of unknown */ case 253: /* number of unknown */
if (ArgList[0]) unknown = my_atol(ArgList[0]);
unknown = my_atol(ArgList[0]);
break; break;
case 254: /* number of channels */ case 254: /* number of channels */
if (ArgList[0]) chans = my_atol(ArgList[0]);
chans = my_atol(ArgList[0]);
break; break;
case 255: /* number of local print it out */ case 255: /* number of local print it out */
BreakArgs(line, NULL, ArgList, 1); BreakArgs(line, NULL, ArgList, 1);