[libgweather/ebassi/gtk4: 22/56] Drop unnecessary condition from index check




commit 6ab613e9e527a337b05e95680e1b265652ba6f3b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun Oct 10 17:27:20 2021 +0100

    Drop unnecessary condition from index check
    
    We only use unsigned integers for indices, which means the "greater than
    zero" check is redundant—and the compiler will tell us that.

 libgweather/gweather-private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgweather/gweather-private.h b/libgweather/gweather-private.h
index 4653536e..8155e217 100644
--- a/libgweather/gweather-private.h
+++ b/libgweather/gweather-private.h
@@ -33,7 +33,7 @@
 #include "gweather-db.h"
 
 #define INVALID_IDX G_MAXUINT16
-#define IDX_VALID(idx) ((idx) >= 0 && (idx) < 0xffff)
+#define IDX_VALID(idx) ((idx) < 0xffff)
 #define EMPTY_TO_NULL(s) ((s)[0] == '\0' ? NULL : (s))
 
 void        _gweather_gettext_init (void);


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