1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Fix inefficient baseDir non-empty check

There's no need to call a string function and have function call
overhead if you remember how C strings work: they have a null
terminator. So if the first char in a string is a null terminator, then
the string is completely empty. So you don't need to call that function.
This commit is contained in:
Misa 2020-08-06 23:17:10 -07:00 committed by Ethan Lee
parent 7478b68dd7
commit ce2eba1649

View file

@ -45,7 +45,7 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
PHYSFS_permitSymbolicLinks(1);
/* Determine the OS user directory */
if (baseDir && strlen(baseDir) > 0)
if (baseDir && baseDir[0] != '\0')
{
strcpy(output, baseDir);