mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[perf] Optimize check for zero length string
strlen has O(n) complexity, checking for first string char is '\0' just O(1).
This commit is contained in:
parent
f667dd6616
commit
c499da9364
1 changed files with 1 additions and 1 deletions
|
@ -445,7 +445,7 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha
|
|||
while ((p_udf_dirent = udf_readdir(p_udf_dirent)) != NULL) {
|
||||
if (FormatStatus) goto out;
|
||||
psz_basename = udf_get_filename(p_udf_dirent);
|
||||
if (strlen(psz_basename) == 0)
|
||||
if (psz_basename[0] == '\0')
|
||||
continue;
|
||||
length = (int)(3 + strlen(psz_path) + strlen(psz_basename) + strlen(psz_extract_dir) + 24);
|
||||
psz_fullpath = (char*)calloc(sizeof(char), length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue