We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f17628 commit f748a34Copy full SHA for f748a34
1 file changed
src/games/gametree.cc
@@ -373,10 +373,11 @@ bool GameNodeRep::IsSubgameRoot() const
373
for (auto infoset : player->GetInfosets()) {
374
const bool precedes =
375
infoset->m_members.front()->IsSuccessorOf(const_cast<GameNodeRep *>(this));
376
- for (size_t mem = 0; mem < infoset->m_members.size(); mem++) {
377
- if (infoset->m_members[mem]->IsSuccessorOf(const_cast<GameNodeRep *>(this)) != precedes) {
378
- return false;
379
- }
+ if (std::any_of(std::next(infoset->m_members.begin()), infoset->m_members.end(),
+ [this, precedes](GameNodeRep *m) {
+ return m->IsSuccessorOf(const_cast<GameNodeRep *>(this)) != precedes;
+ })) {
380
+ return false;
381
}
382
383
0 commit comments