]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Exit quickly if there's nothing to do
authorNick Porter <nick@portercomputing.co.uk>
Tue, 1 Apr 2025 14:14:31 +0000 (15:14 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 1 Apr 2025 16:58:57 +0000 (17:58 +0100)
src/lib/util/value.c

index 61be4346b8bc2289e40fe29fdf62e9fcd534f7d2..aef20f9768e87368d647c3e0ce7bbf5f07f71e76 100644 (file)
@@ -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;