]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
User newer type check function
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 7 Oct 2021 01:32:06 +0000 (20:32 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 7 Oct 2021 01:48:10 +0000 (20:48 -0500)
src/lib/util/pair.c

index 7c0f32eb8788a4c40cf27bd46ffc3c501cf0c80e..de5b6bd49acf2aed77340027c08f6ccdbdddce7a 100644 (file)
@@ -612,17 +612,14 @@ fr_pair_t *fr_pair_find_by_child_num(fr_pair_list_t *list, fr_dict_attr_t const
        return NULL;
 }
 
-static inline CC_HINT(always_inline) fr_pair_list_t *pair_children(fr_pair_t *vp)
+/** Return a pointer to the pair list
+ *
+ */
+static inline CC_HINT(always_inline) CC_HINT(nonnull) fr_pair_list_t *pair_children(fr_pair_t *vp)
 {
-       if (!vp) return NULL;
-
-       switch (vp->da->type) {
-       case FR_TYPE_STRUCTURAL:
-               return &vp->vp_group;
+       if (fr_type_is_structural(vp->da->type)) return &vp->vp_group;
 
-       default:
-               return NULL;
-       }
+       return NULL;
 }
 
 /** Get the child list of a group