[libgweather/ebassi/gtk4: 9/10] Drop unnecessary condition from index check
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/ebassi/gtk4: 9/10] Drop unnecessary condition from index check
- Date: Sun, 10 Oct 2021 16:50:25 +0000 (UTC)
commit 2d0694f26be861fd2483618cf05ea5b81712abbd
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]