[gnome-software: 5/18] gs-utils: Clarify some negative flag conditions




commit 339e1ef91c5626701047ba4634b844de18848616
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Mar 4 22:23:06 2021 +0000

    gs-utils: Clarify some negative flag conditions
    
    As with normal booleans, it’s easier to see the sense of the condition
    if the negation is at the front (where you’ll read it first, when
    skim-reading code) rather than at the end (` == 0`).
    
    This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 lib/gs-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-utils.c b/lib/gs-utils.c
index 5e8deaab3..1c8a3056d 100644
--- a/lib/gs-utils.c
+++ b/lib/gs-utils.c
@@ -171,7 +171,7 @@ gs_utils_get_cache_filename (const gchar *kind,
        }
 
        /* not writable, so try the system cache first */
-       if ((flags & GS_UTILS_CACHE_FLAG_WRITEABLE) == 0) {
+       if (!(flags & GS_UTILS_CACHE_FLAG_WRITEABLE)) {
                g_autofree gchar *cachefn = NULL;
                cachefn = g_build_filename (LOCALSTATEDIR,
                                            "cache",
@@ -186,7 +186,7 @@ gs_utils_get_cache_filename (const gchar *kind,
        }
 
        /* not writable, so try the system cache first */
-       if ((flags & GS_UTILS_CACHE_FLAG_WRITEABLE) == 0) {
+       if (!(flags & GS_UTILS_CACHE_FLAG_WRITEABLE)) {
                g_autofree gchar *cachefn = NULL;
                cachefn = g_build_filename (DATADIR,
                                            "gnome-software",


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