From 15dedf12698fbbb4b89e4d1c010dcc7e161d6613 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Wed, 6 Oct 2021 20:32:06 -0500 Subject: [PATCH] User newer type check function --- src/lib/util/pair.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 -- 2.47.2