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.
diff --git a/src/map.c b/src/map.c
index 73e057e..577d418 100644
--- a/src/map.c
+++ b/src/map.c
@@ -161,9 +161,8 @@
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;
}
diff --git a/src/vars.c b/src/vars.c
index ed30846..3ad0c16 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -249,9 +249,8 @@
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 @@
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 @@
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;
}