Minor rewriting.

This commit is contained in:
svdijk 2013-03-17 21:32:50 +01:00
parent e49693bec4
commit 317355f7ca
2 changed files with 7 additions and 11 deletions

View File

@ -701,12 +701,10 @@ Cmd_AddCommand(char *cmd_name, xcommand_t function)
cmd->function = function;
/* link the command in */
for (pos = &cmd_functions; *pos; pos = &(*pos)->next)
pos = &cmd_functions;
while (*pos && strcmp((*pos)->name, cmd->name) < 0)
{
if (strcmp(cmd->name, (*pos)->name) < 0)
{
break;
}
pos = &(*pos)->next;
}
cmd->next = *pos;
*pos = cmd;

View File

@ -177,12 +177,10 @@ Cvar_Get(char *var_name, char *var_value, int flags)
var->value = strtod(var->string, (char **)NULL);
/* link the variable in */
for (pos = &cvar_vars; *pos; pos = &(*pos)->next)
pos = &cvar_vars;
while (*pos && strcmp((*pos)->name, var->name) < 0)
{
if (strcmp(var->name, (*pos)->name) < 0)
{
break;
}
pos = &(*pos)->next;
}
var->next = *pos;
*pos = var;