@@ -79,33 +79,34 @@ struct ray_intersector_impl<cartesian2D<algebra_t>, algebra_t, do_debug> {
79
79
80
80
// Check if we divided by zero
81
81
const auto check_sum = is.path .sum ();
82
- if (!std::isnan (check_sum) && !std::isinf (check_sum)) {
83
-
84
- const point3_type p3 = ro + is.path * rd;
85
- const auto loc = mask_t::to_local_frame (trf, p3, rd);
86
- if constexpr (intersection_type<surface_descr_t >::is_debug ()) {
87
- is.local = loc;
88
- }
89
- is.status = mask.is_inside (
90
- loc,
91
- math::max (mask_tolerance[0 ],
92
- math::min (mask_tolerance[1 ],
93
- mask_tol_scalor * math::fabs (is.path ))));
94
-
95
- // Early return, if no intersection was found
96
- if (detray::detail::none_of (is.status )) {
97
- return is;
82
+ if (!std::isnan (check_sum) && !std::isinf (check_sum))
83
+ [[likely]] {
84
+
85
+ const point3_type p3 = ro + is.path * rd;
86
+ const auto loc = mask_t::to_local_frame (trf, p3, rd);
87
+ if constexpr (intersection_type<surface_descr_t >::is_debug ()) {
88
+ is.local = loc;
89
+ }
90
+ is.status = mask.is_inside (
91
+ loc, math::max (
92
+ mask_tolerance[0 ],
93
+ math::min (mask_tolerance[1 ],
94
+ mask_tol_scalor * math::fabs (is.path ))));
95
+
96
+ // Early return, if no intersection was found
97
+ if (detray::detail::none_of (is.status )) {
98
+ return is;
99
+ }
100
+
101
+ is.sf_desc = sf;
102
+ is.direction = !math::signbit (is.path );
103
+ is.volume_link = mask.volume_link ();
104
+
105
+ // Mask the values where the overstepping tolerance was not met
106
+ is.status &= (is.path >= overstep_tol);
98
107
}
99
-
100
- is.sf_desc = sf;
101
- is.direction = !math::signbit (is.path );
102
- is.volume_link = mask.volume_link ();
103
-
104
- // Mask the values where the overstepping tolerance was not met
105
- is.status &= (is.path >= overstep_tol);
106
- } else {
107
- is.status = decltype (is.status )(false );
108
- }
108
+ else
109
+ [[unlikely]] { is.status = decltype (is.status )(false ); }
109
110
110
111
return is;
111
112
}
0 commit comments