cvar, prvm_cmds: Remove redundant Cmd_Exists checks
authorCloudwalk <cloudwalk009@gmail.com>
Tue, 25 May 2021 23:21:59 +0000 (19:21 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Tue, 25 May 2021 23:21:59 +0000 (19:21 -0400)
cvar.c
prvm_cmds.c

diff --git a/cvar.c b/cvar.c
index ce1e065254ac1bba166c1b34b7fc201813e7ef1d..344512d0946f6b1bce6ff8666f648f42ae687791 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -647,7 +647,7 @@ void Cvar_RegisterVariable (cvar_t *variable)
        }
 
        // check for overlap with a command
        }
 
        // check for overlap with a command
-       if (Cmd_Exists(cmd_local, variable->name) || Cmd_Exists(cmd_local, variable->name))
+       if (Cmd_Exists(cmd_local, variable->name))
        {
                Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name);
                return;
        {
                Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name);
                return;
@@ -712,7 +712,7 @@ cvar_t *Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, int f
        }
 
        // check for overlap with a command
        }
 
        // check for overlap with a command
-       if (Cmd_Exists(cmd_local, name) || Cmd_Exists(cmd_local, name))
+       if (Cmd_Exists(cmd_local, name))
        {
                Con_Printf("Cvar_Get: %s is a command\n", name);
                return NULL;
        {
                Con_Printf("Cvar_Get: %s is a command\n", name);
                return NULL;
index 68e17589870d09bd890ef67ba6da3cdf3090f2d5..07adabf396246c2a6ec3b0e140ff3d389b1813c7 100644 (file)
@@ -1696,7 +1696,7 @@ void VM_registercvar(prvm_prog_t *prog)
                return;
 
 // check for overlap with a command
                return;
 
 // check for overlap with a command
-       if (Cmd_Exists(cmd_local, name) || Cmd_Exists(cmd_local, name))
+       if (Cmd_Exists(cmd_local, name))
        {
                VM_Warning(prog, "VM_registercvar: %s is a command\n", name);
                return;
        {
                VM_Warning(prog, "VM_registercvar: %s is a command\n", name);
                return;