mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 14:21:00 +01:00
CLEANUP: pattern: rename pat_ref_commit() to pat_ref_commit_elt()
It's about the third time I get confused by these functions, half of which manipulate the reference as a whole and those manipulating only an entry. For me "pat_ref_commit" means committing the pattern reference, not just an element, so let's rename it. A number of other ones should really be renamed before 2.4 gets released :-/
This commit is contained in:
parent
6a9060189d
commit
dc2410d093
@ -191,7 +191,7 @@ int pat_ref_delete(struct pat_ref *ref, const char *key);
|
|||||||
void pat_ref_delete_by_ptr(struct pat_ref *ref, struct pat_ref_elt *elt);
|
void pat_ref_delete_by_ptr(struct pat_ref *ref, struct pat_ref_elt *elt);
|
||||||
int pat_ref_delete_by_id(struct pat_ref *ref, struct pat_ref_elt *refelt);
|
int pat_ref_delete_by_id(struct pat_ref *ref, struct pat_ref_elt *refelt);
|
||||||
int pat_ref_prune(struct pat_ref *ref);
|
int pat_ref_prune(struct pat_ref *ref);
|
||||||
int pat_ref_commit(struct pat_ref *ref, struct pat_ref_elt *elt, char **err);
|
int pat_ref_commit_elt(struct pat_ref *ref, struct pat_ref_elt *elt, char **err);
|
||||||
int pat_ref_purge_older(struct pat_ref *ref, unsigned int oldest, int budget);
|
int pat_ref_purge_older(struct pat_ref *ref, unsigned int oldest, int budget);
|
||||||
void pat_ref_reload(struct pat_ref *ref, struct pat_ref *replace);
|
void pat_ref_reload(struct pat_ref *ref, struct pat_ref *replace);
|
||||||
|
|
||||||
|
|||||||
@ -1965,7 +1965,7 @@ int pat_ref_push(struct pat_ref_elt *elt, struct pattern_expr *expr,
|
|||||||
* pointer <err> may have been updated (and the caller must free it). Failure
|
* pointer <err> may have been updated (and the caller must free it). Failure
|
||||||
* causes include memory allocation, parsing error or indexing error.
|
* causes include memory allocation, parsing error or indexing error.
|
||||||
*/
|
*/
|
||||||
int pat_ref_commit(struct pat_ref *ref, struct pat_ref_elt *elt, char **err)
|
int pat_ref_commit_elt(struct pat_ref *ref, struct pat_ref_elt *elt, char **err)
|
||||||
{
|
{
|
||||||
struct pattern_expr *expr;
|
struct pattern_expr *expr;
|
||||||
|
|
||||||
@ -1996,7 +1996,7 @@ struct pat_ref_elt *pat_ref_load(struct pat_ref *ref, unsigned int gen,
|
|||||||
elt = pat_ref_append(ref, pattern, sample, line);
|
elt = pat_ref_append(ref, pattern, sample, line);
|
||||||
if (elt) {
|
if (elt) {
|
||||||
elt->gen_id = gen;
|
elt->gen_id = gen;
|
||||||
if (!pat_ref_commit(ref, elt, err))
|
if (!pat_ref_commit_elt(ref, elt, err))
|
||||||
elt = NULL;
|
elt = NULL;
|
||||||
} else
|
} else
|
||||||
memprintf(err, "out of memory error");
|
memprintf(err, "out of memory error");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user