From 07728abbc1eb1aa91d21318f3a3d64b15c2800fe Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 21 Jan 2008 15:30:40 +0000 Subject: Checking first char for null is more efficient than strlen. --- src/librc/librc-depend.c | 4 ++-- src/librc/librc-misc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/librc') diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c index 4ccd7ee2..c6ebf495 100644 --- a/src/librc/librc-depend.c +++ b/src/librc/librc-depend.c @@ -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) diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index be911e9f..db6209fd 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -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) { -- cgit v1.2.3