mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-01 11:01:46 +00:00
MINOR: samples: data assignation simplification
With the difference between the "struct sample" data and the "struct sample_storage" data, it was not possible to write data = data, and we did a memcpy. This patch remove some of these memcpy.
This commit is contained in:
parent
2046c46468
commit
5cc18d46f3
@ -161,9 +161,8 @@ static int sample_conv_map(const struct arg *arg_p, struct sample *smp, void *pr
|
||||
if (pat) {
|
||||
/* Copy sample. */
|
||||
if (pat->data) {
|
||||
smp->data.type = pat->data->type;
|
||||
smp->data = *pat->data;
|
||||
smp->flags |= SMP_F_CONST;
|
||||
memcpy(&smp->data.u, &pat->data->u, sizeof(smp->data.u));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -249,9 +249,8 @@ static int smp_fetch_var(const struct arg *args, struct sample *smp, const char
|
||||
return 0;
|
||||
|
||||
/* Copy sample. */
|
||||
smp->data.type = var->data.type;
|
||||
smp->data = var->data;
|
||||
smp->flags |= SMP_F_CONST;
|
||||
memcpy(&smp->data.u, &var->data.u, sizeof(smp->data.u));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -442,9 +441,8 @@ int vars_get_by_name(const char *name, size_t len, struct stream *strm, struct s
|
||||
return 0;
|
||||
|
||||
/* Copy sample. */
|
||||
smp->data.type = var->data.type;
|
||||
smp->data = var->data;
|
||||
smp->flags = SMP_F_CONST;
|
||||
memcpy(&smp->data.u, &var->data.u, sizeof(smp->data.u));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -476,9 +474,8 @@ int vars_get_by_desc(const struct var_desc *var_desc, struct stream *strm, struc
|
||||
return 0;
|
||||
|
||||
/* Copy sample. */
|
||||
smp->data.type = var->data.type;
|
||||
smp->data = var->data;
|
||||
smp->flags = SMP_F_CONST;
|
||||
memcpy(&smp->data.u, &var->data.u, sizeof(smp->data.u));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user