Checking first char for null is more efficient than strlen.

This commit is contained in:
Roy Marples
2008-01-21 15:30:40 +00:00
parent 847ccac13c
commit 07728abbc1
5 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ rc_depinfo_t *rc_deptree_load (void)
{
/* Sanity */
e = get_shell_value (p);
if (! e || strlen (e) == 0)
if (! e || *e == '\0')
goto next;
if (! deptree)
@@ -176,7 +176,7 @@ rc_depinfo_t *rc_deptree_load (void)
/* Sanity */
e = get_shell_value (p);
if (! e || strlen (e) == 0)
if (! e || *e == '\0')
goto next;
if (! deptype)
+1 -1
View File
@@ -196,7 +196,7 @@ char **rc_config_load (const char *file)
do {
/* Bash variables are usually quoted */
token = strsep (&line, "\"\'");
} while ((token) && (strlen (token) == 0));
} while (token && *token == '\0');
/* Drop a newline if that's all we have */
if (token) {