@@ -852,19 +852,21 @@ void GameTreeRep::MakeReducedStrategies() const
852852 }
853853
854854 auto [action, node] = *current_iter;
855- if (!node->GetParent ()->GetPlayer ()->IsChance () &&
856- current_iter == node->GetParent ()->GetActions ().begin ()) {
855+ const auto player = node->GetParent ()->GetPlayer ();
856+ const auto infoset = node->GetParent ()->GetInfoset ();
857+ if (const auto parent = node->m_parent ;
858+ !player->IsChance () && current_iter == parent->GetActions ().begin ()) {
857859 // Update behaviors conditional on parent information set being reachable
858- auto behav = behaviors[node-> GetParent ()-> GetPlayer () ].begin ();
859- while (behav != behaviors[node-> GetParent ()-> GetPlayer () ].end ()) {
860- if (MatchesPartialHistory (*behav, history, node-> GetParent ()-> GetInfoset () )) {
861- auto act = node-> GetParent ()-> GetInfoset () ->GetActions ().begin ();
862- (*behav)[node-> GetParent ()-> GetInfoset () .get ()] = *act;
860+ auto behav = behaviors[player ].begin ();
861+ while (behav != behaviors[player ].end ()) {
862+ if (MatchesPartialHistory (*behav, history, infoset )) {
863+ auto act = infoset ->GetActions ().begin ();
864+ (*behav)[infoset .get ()] = *act;
863865 ++behav;
864866 ++act;
865- while (act != node-> GetParent ()-> GetInfoset () ->GetActions ().end ()) {
866- behaviors[node-> GetParent ()-> GetPlayer () ].insert (behav, *std::prev (behav));
867- (*std::prev (behav))[node-> GetParent ()-> GetInfoset () .get ()] = *act;
867+ while (act != infoset ->GetActions ().end ()) {
868+ behaviors[player ].insert (behav, *std::prev (behav));
869+ (*std::prev (behav))[infoset .get ()] = *act;
868870 ++act;
869871 }
870872 }
0 commit comments