Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
MelchiorSchuh committed Oct 2, 2024
1 parent 6eddb11 commit 7ab977a
Showing 1 changed file with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

0 comments on commit 7ab977a

Please sign in to comment.