From 7ab977a130ed2c93171bf6c5c837746dd7a57c5b Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Wed, 2 Oct 2024 11:53:45 +0200 Subject: [PATCH] fixed test --- .../representation/core/detail/helpers.cpp | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp b/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp index d66e6b1..a2a2ddf 100644 --- a/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp +++ b/src/geode/geosciences/implicit/representation/core/detail/helpers.cpp @@ -373,23 +373,11 @@ namespace geode const HorizonsStack< dimension >& horizon_stack, absl::string_view horizon_name ) { - const auto bottom_horizon = horizon_stack.bottom_horizon(); - std::optional< uuid > current_horizon = bottom_horizon; - while( current_horizon ) + for( const auto& horizon : horizon_stack.horizons() ) { - if( horizon_stack.horizon( current_horizon.value() ).name() - == horizon_name ) - { - return current_horizon; - } - if( const auto su_above = - horizon_stack.above( bottom_horizon ) ) + if( horizon.name() == horizon_name ) { - current_horizon = horizon_stack.above( su_above.value() ); - } - else - { - break; + return horizon.id(); } } return std::nullopt; @@ -452,9 +440,9 @@ namespace geode repair_horizon_stack_if_possible< 3 >( const HorizonsStack< 3 >&, HorizonsStackBuilder< 3 >& ); - template std::optional< uuid > horizon_id_from_name( + template std::optional< uuid > horizon_id_from_name< 2 >( const HorizonsStack< 2 >&, absl::string_view ); - template std::optional< uuid > horizon_id_from_name( + template std::optional< uuid > horizon_id_from_name< 3 >( const HorizonsStack< 3 >&, absl::string_view ); } // namespace detail } // namespace geode \ No newline at end of file