commit 240b2c12c14dc1e6522cbf4d3be95f42fe92f6c3
parent 4c642de68673bb35c1cc92d5b8e92573e982f3ed
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 10 Jul 2024 10:37:32 +0200
Small refactoring
Move some of the code in the boundary probe calculation to the block of
code where it's really needed. Until now, the variables and lines of
code now moved were declared and executed outside the if directive,
which is actually the one in which these variables and code make sense.
Diffstat:
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/stardis-compute-probe-boundary.c b/src/stardis-compute-probe-boundary.c
@@ -342,10 +342,6 @@ move_to_boundary
double proj_pos[3] = {0,0,0};
size_t iprim = 0;
- /* Properties */
- const struct description* desc_list = NULL;
- const struct description* desc = NULL;
- unsigned desc_ids[SG3D_PROP_TYPES_COUNT__];
/* Miscellaneous */
size_t nvertices_close = 0;
@@ -355,12 +351,17 @@ move_to_boundary
ASSERT(stardis && pos && time >= 0 && out_iprim && uv);
ERR(find_closest_point(stardis, pos, &filter_ctx, &iprim, uv));
- SG3D(geometry_get_unique_triangle_properties
- (stardis->geometry.sg3d, (unsigned)iprim, desc_ids));
-
- desc_list = darray_descriptions_cdata_get(&stardis->descriptions);
if(filter_ctx.side != SG3D_INTFACE) {
+ /* Properties */
+ const struct description* desc_list = NULL;
+ const struct description* desc = NULL;
+ unsigned desc_ids[SG3D_PROP_TYPES_COUNT__];
+
+ SG3D(geometry_get_unique_triangle_properties
+ (stardis->geometry.sg3d, (unsigned)iprim, desc_ids));
+
+ desc_list = darray_descriptions_cdata_get(&stardis->descriptions);
/* Probe is outside the system */
if(desc_ids[filter_ctx.side] == SG3D_UNSPECIFIED_PROPERTY) {