]> pilppa.com Git - uci.git/commitdiff
simplify code (thx, henning)
authorFelix Fietkau <nbd@openwrt.org>
Sat, 23 Jan 2010 19:55:55 +0000 (20:55 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 17 Aug 2010 11:08:56 +0000 (13:08 +0200)
ucimap.c

index 52c920b39323a88f0906b8f14fd59c2015cadd98..9853e7e89fb337207cd122d486da68ce1c912722 100644 (file)
--- a/ucimap.c
+++ b/ucimap.c
@@ -59,23 +59,13 @@ struct ucimap_fixup {
 static inline bool
 ucimap_is_alloc(enum ucimap_type type)
 {
-       switch(type & UCIMAP_SUBTYPE) {
-       case UCIMAP_STRING:
-               return true;
-       default:
-               return false;
-       }
+       return (type & UCIMAP_SUBTYPE) == UCIMAP_STRING;
 }
 
 static inline bool
 ucimap_is_fixup(enum ucimap_type type)
 {
-       switch(type & UCIMAP_SUBTYPE) {
-       case UCIMAP_SECTION:
-               return true;
-       default:
-               return false;
-       }
+       return (type & UCIMAP_SUBTYPE) == UCIMAP_SECTION;
 }
 
 static inline bool