From: Arran Cudbard-Bell Date: Thu, 7 Oct 2021 01:32:06 +0000 (-0500) Subject: User newer type check function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15dedf12698fbbb4b89e4d1c010dcc7e161d6613;p=thirdparty%2Ffreeradius-server.git User newer type check function --- diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 7c0f32eb87..de5b6bd49a 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -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