Optimization: Removed unneeded strlen() calls several places.

This commit is contained in:
Jan Vidar Krey
2009-03-02 19:41:49 +01:00
parent ac56e7a5b9
commit 26766d8332
6 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -38,8 +38,8 @@ char* strip_white_space(char* string)
while (string[0] && is_white_space(string[0])) string++;
if (!strlen(string))
return string;
if (!*string)
return 0;
/* Strip appending whitespace */
pos = &string[strlen(string)-1];
@@ -187,7 +187,7 @@ int file_read_lines(const char* file, void* data, file_line_handler_t handler)
while ((pos = strchr(start, '\n')))
{
pos[0] = '\0';
if (strlen(start) > 0)
if (*start)
{
hub_log(log_dump, "Line: %s", start);
if (handler(start, line_count+1, data) < 0)
@@ -197,7 +197,7 @@ int file_read_lines(const char* file, void* data, file_line_handler_t handler)
line_count++;
}
if (strlen(start) > 0)
if (*start)
{
buf[strlen(start)] = 0;
hub_log(log_dump, "Line: %s", start);