[libgweather/ebassi/gtk4: 18/28] Drop unnecessary condition from index check
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/ebassi/gtk4: 18/28] Drop unnecessary condition from index check
- Date: Mon, 11 Oct 2021 14:26:22 +0000 (UTC)
commit 31f2d2cde161bd531746a03aa31b7dd66d5ca989
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]