[libgtop] Use g_ascii_isspace instead of isspace because the later is slower and we only need to deal with asc



commit 01a56e2e30877e21d1258d2606111166dd6883eb
Author: Benoît Dejean <bdejean gmail com>
Date:   Thu Oct 13 19:33:19 2016 +0200

    Use g_ascii_isspace instead of isspace because the later is slower and we
    only need to deal with ascii.

 sysdeps/linux/glibtop_private.c |    2 +-
 sysdeps/linux/glibtop_private.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c
index 5fff735..d3a49aa 100644
--- a/sysdeps/linux/glibtop_private.c
+++ b/sysdeps/linux/glibtop_private.c
@@ -51,7 +51,7 @@ char *
 skip_token (const char *p)
 {
        p = next_token(p);
-       while (*p && !isspace(*p)) p++;
+       while (*p && !g_ascii_isspace(*p)) p++;
        p = next_token(p);
        return (char *)p;
 }
diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h
index d00a152..03761f4 100644
--- a/sysdeps/linux/glibtop_private.h
+++ b/sysdeps/linux/glibtop_private.h
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
 static inline char*
 next_token(const char *p)
 {
-       while (isspace(*p)) p++;
+       while (g_ascii_isspace(*p)) p++;
        return (char*) p;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]