Avoid unchecked mutation offer access
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 3m38s
Foundation / checks (checks) (push) Canceled after 3m44s
Foundation / checks (network) (push) Canceled after 1m43s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 3m38s
Foundation / checks (checks) (push) Canceled after 3m44s
Foundation / checks (network) (push) Canceled after 1m43s
This commit is contained in:
@@ -991,7 +991,7 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
|
||||
return std::unexpected{CellularLivesError::mutation};
|
||||
if (!life->mutation.offer.has_value())
|
||||
return std::unexpected{CellularLivesError::mutation};
|
||||
const auto& offer = life->mutation.offer.value();
|
||||
const auto offer = life->mutation.offer.value_or(biology::MutationOffer{});
|
||||
if (offer.parent != life->identity.genome ||
|
||||
offer.context.event_index != selection.event_index ||
|
||||
!std::ranges::any_of(offer.candidates,
|
||||
@@ -1115,7 +1115,7 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
|
||||
const auto parent = next_archive.find(found->identity.genome);
|
||||
if (!parent || !found->mutation.offer.has_value())
|
||||
return std::unexpected{CellularLivesError::mutation};
|
||||
const auto& offer = found->mutation.offer.value();
|
||||
const auto offer = found->mutation.offer.value_or(biology::MutationOffer{});
|
||||
auto transition =
|
||||
biology::fund_mutation(*parent, offer.context, offer, selection.operator_id,
|
||||
selection.successor_id, selection.successor_id, found->reserve);
|
||||
|
||||
Reference in New Issue
Block a user