]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pattern: add _pat_ref_new() helper func
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Nov 2024 09:01:40 +0000 (10:01 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Nov 2024 10:36:01 +0000 (11:36 +0100)
commitd1397401f04b4f920b1d545912f96d9f67c23daf
tree72179d172ecc979f1693d9a80729bd0248ccada0
parent79a346aa283af1de1094893f0517bda6c0d39e9a
MINOR: pattern: add _pat_ref_new() helper func

pat_ref_newid() and pat_ref_new() are two functions to create and
initialize a pat_ref struct based on input parameters.

Both function perform the same generic allocation and initialization
for pat_ref struct, thus there is quite a lot of code redundancy.

This is error-prone if the pat_ref init sequence has to be updated at
some point.

To reduce maintenance costs, let's add a _pat_ref_new() helper func that
takes care of the generic allocation and base initialization for pat_ref
struct.
src/pattern.c