We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a65784d + b5897f9 commit 107eeaaCopy full SHA for 107eeaa
src/games/game.cc
@@ -449,10 +449,8 @@ template <class T> Vector<T> MixedStrategyProfile<T>::operator[](const GamePlaye
449
CheckVersion();
450
auto strategies = m_rep->m_support.GetStrategies(p_player);
451
Vector<T> probs(strategies.size());
452
- int st = 1;
453
- for (auto strategy : strategies) {
454
- probs[st] = (*this)[strategy];
455
- }
+ std::transform(strategies.begin(), strategies.end(), probs.begin(),
+ [this](const GameStrategy &s) { return (*m_rep)[s]; });
456
return probs;
457
}
458
0 commit comments