]> granicus.if.org Git - mutt/commitdiff
mutt_strlen() optimizations from Byrial Jensen.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 21 Dec 1998 10:37:31 +0000 (10:37 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 21 Dec 1998 10:37:31 +0000 (10:37 +0000)
from.c
lib.c
parse.c

diff --git a/from.c b/from.c
index c8e2d88e8ddf69fcb12eeabe65f095f7847f07f4..01ff421994dbc42ee275690ad521ddc5c43b82b3 100644 (file)
--- a/from.c
+++ b/from.c
@@ -44,7 +44,7 @@ static int is_day_name (const char *s)
 {
   int i;
 
-  if ((mutt_strlen(s) < 3) || !*(s + 3) || !ISSPACE (*(s+3)))
+  if ((strlen (s) < 3) || !*(s + 3) || !ISSPACE (*(s+3)))
     return 0;
   for (i=0; i<7; i++)
     if (mutt_strncasecmp (s, Weekdays[i], 3) == 0)
diff --git a/lib.c b/lib.c
index ffacd31f8dc041da4b3efc31a8ad313b249d92ea..a5b0e081cf95d7ecf72e6a026a9a03dd4ba4a3c8 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -342,8 +342,9 @@ char *safe_strdup (const char *s)
   char *p;
   size_t l;
 
-  if (!s || !*s) return 0;
-  l = mutt_strlen (s) + 1;
+  if (!s || !*s)
+    return 0;
+  l = strlen (s) + 1;
   p = (char *)safe_malloc (l);
   memcpy (p, s, l);
   return (p);
@@ -1283,5 +1284,5 @@ int mutt_strncasecmp(const char *a, const char *b, size_t l)
 
 size_t mutt_strlen(const char *a)
 {
-  return strlen(NONULL(a));
+  return a ? strlen (a) : 0;
 }
diff --git a/parse.c b/parse.c
index 9a8e94398d8bcdd4973de95d55ed719940a52090..ad8be3f3c5e6ee705c24789bfc1ea9bd016b515e 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -55,7 +55,7 @@ static char *read_rfc822_line (FILE *f, char *line, size_t *linelen)
       return (line);
     }
 
-    buf += mutt_strlen (buf) - 1;
+    buf += strlen (buf) - 1;
     if (*buf == '\n')
     {
       /* we did get a full line. remove trailing space */
@@ -1165,7 +1165,7 @@ ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr, short user_hdrs)
       }
       else
        last = e->userhdrs = mutt_new_list ();
-      line[mutt_strlen (line)] = ':';
+      line[strlen (line)] = ':';
       last->data = safe_strdup (line);
     }