Skip to content

Commit 9fd759e

Browse files
committed
Remove unneeded GetMembers
1 parent c829a6c commit 9fd759e

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

src/games/behavspt.cc

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ void BehaviorSupportProfile::AddAction(const GameAction &p_action)
7373
if (pos == support.end() || *pos != p_action) {
7474
// Action is not in the support at the infoset; add at this location to keep sorted by number
7575
support.insert(pos, p_action);
76-
for (const auto &node : GetMembers(p_action->GetInfoset())) {
77-
ActivateSubtree(node->GetChild(p_action));
76+
for (const auto &node : p_action->GetInfoset()->GetMembers()) {
77+
if (m_nonterminalReachable[node]) {
78+
ActivateSubtree(node->GetChild(p_action));
79+
}
7880
}
7981
}
8082
}
@@ -86,8 +88,10 @@ bool BehaviorSupportProfile::RemoveAction(const GameAction &p_action)
8688
auto pos = std::find(support.begin(), support.end(), p_action);
8789
if (pos != support.end()) {
8890
support.erase(pos);
89-
for (const auto &node : GetMembers(p_action->GetInfoset())) {
90-
DeactivateSubtree(node->GetChild(p_action));
91+
for (const auto &node : p_action->GetInfoset()->GetMembers()) {
92+
if (m_nonterminalReachable[node]) {
93+
DeactivateSubtree(node->GetChild(p_action));
94+
}
9195
}
9296
return !support.empty();
9397
}
@@ -139,17 +143,6 @@ void BehaviorSupportProfile::DeactivateSubtree(const GameNode &n)
139143
}
140144
}
141145

142-
std::list<GameNode> BehaviorSupportProfile::GetMembers(const GameInfoset &p_infoset) const
143-
{
144-
std::list<GameNode> answer;
145-
for (const auto &member : p_infoset->GetMembers()) {
146-
if (m_nonterminalReachable.at(member)) {
147-
answer.push_back(member);
148-
}
149-
}
150-
return answer;
151-
}
152-
153146
//========================================================================
154147
// BehaviorSupportProfile: Sequence form
155148
//========================================================================

src/games/behavspt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ class BehaviorSupportProfile {
130130
//@{
131131
/// Can the information set be reached under this support?
132132
bool IsReachable(const GameInfoset &p_infoset) const { return m_infosetReachable.at(p_infoset); }
133-
/// Get the members of the information set reachable under the support
134-
std::list<GameNode> GetMembers(const GameInfoset &) const;
135133
//@}
136134

137135
class Infosets {

0 commit comments

Comments
 (0)