Merge pull request #1162 from devnexen/cmdparser_optim

cmdparser/server command little optimisations.
This commit is contained in:
Yamagi 2024-11-23 08:49:48 +01:00 committed by GitHub
commit 8b9f506a50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -908,7 +908,7 @@ Cmd_CompleteMapCommand(char *partial)
{
char **mapNames;
int i, j, k, nbMatches, len, nMaps;
char *mapName;
char *mapName, *lastsep;
char *pmatch[1024];
qboolean partialFillContinue = true;
@ -920,9 +920,9 @@ Cmd_CompleteMapCommand(char *partial)
for (i = 0; i < nMaps - 1; i++)
{
if (strrchr(mapNames[i], '/'))
if ((lastsep = strrchr(mapNames[i], '/')))
{
mapName = strrchr(mapNames[i], '/') + 1;
mapName = lastsep + 1;
}
else
{

View file

@ -317,7 +317,7 @@ void SV_ListMaps_f(void)
char **userMapNames;
int nUserMaps = 0;
int i;
char* mapName;
char* mapName, *lastsep;
Com_Printf("\n");
@ -325,9 +325,9 @@ void SV_ListMaps_f(void)
{
for (i = 0; i < nUserMaps - 1; i++)
{
if (strrchr(userMapNames[i], '/'))
if ((lastsep = strrchr(userMapNames[i], '/')))
{
mapName = strrchr(userMapNames[i], '/') + 1;
mapName = lastsep + 1;
}
else
{