[gnome-builder] core: add non-NULL string comparison

commit 2dfbeec172e85acd8e86b7624014558831609032
Author: Christian Hergert <chergert redhat com>
Date:   Thu Apr 18 13:06:39 2019 -0700

    core: add non-NULL string comparison
    We don't need to waste cycles on NULL comparisons in some cases, so provide
    a non-NULL form of ide_str_equal0() so that we can use strcmp and the
    internal optimizations that the compiler can give us.

 src/libide/core/ide-macros.h | 1 +
 1 file changed, 1 insertion(+)
diff --git a/src/libide/core/ide-macros.h b/src/libide/core/ide-macros.h
index 2224d12c6..198906be3 100644
--- a/src/libide/core/ide-macros.h
+++ b/src/libide/core/ide-macros.h
@@ -35,6 +35,7 @@
 #define ide_str_empty0(str)       (!(str) || !*(str))
+#define ide_str_equal(str1,str2)  (strcmp(str1,str2)==0)
 #define ide_str_equal0(str1,str2) (g_strcmp0(str1,str2)==0)
 #define ide_strv_empty0(strv)     (((strv) == NULL) || ((strv)[0] == NULL))
 #define ide_set_string(ptr,str)   (ide_take_string((ptr), g_strdup(str)))

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