From: Nick Porter Date: Tue, 1 Apr 2025 14:14:31 +0000 (+0100) Subject: Exit quickly if there's nothing to do X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37dc14977dd676675131f8c626b236938136d1d0;p=thirdparty%2Ffreeradius-server.git Exit quickly if there's nothing to do --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 61be4346b8b..aef20f9768e 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -5751,6 +5751,12 @@ int fr_value_box_list_concat_in_place(TALLOC_CTX *ctx, return -1; } + /* + * Exit quickly if the list is only one box of the correct type and + * out points at that box. + */ + if ((fr_value_box_list_num_elements(list) == 1) && (head_vb == out) && (head_vb->type == type)) return 0; + switch (type) { case FR_TYPE_STRING: if (unlikely(!fr_sbuff_init_talloc(ctx, &sbuff, &sbuff_tctx, 256, max_size))) return -1;