@@ -1111,14 +1111,15 @@ void GameFrame::OnViewStrategic(wxCommandEvent &p_event)
11111111 return ;
11121112 }
11131113
1114- const int ncont = m_doc->GetGame ()->NumStrategyContingencies ();
1115- if (!m_nfgPanel && ncont >= 50000 ) {
1116- if (wxMessageBox (
1117- wxString::Format (wxT (" This game has %d contingencies in strategic form.\n " ), ncont) +
1118- wxT (" Performance in browsing strategic form will be poor,\n " ) +
1119- wxT (" and may render the program nonresponsive.\n " ) +
1120- wxT (" Do you wish to continue?" ),
1121- _ (" Large strategic game warning" ), wxOK | wxCANCEL | wxALIGN_CENTER, this ) != wxOK) {
1114+ if (const size_t contingencies = m_doc->GetGame ()->GetStrategies ().extent_product ();
1115+ !m_nfgPanel && contingencies >= 50000 ) {
1116+ if (wxMessageBox (wxString::Format (wxT (" This game has %d contingencies in strategic form.\n " ),
1117+ contingencies) +
1118+ wxT (" Performance in browsing strategic form will be poor,\n " ) +
1119+ wxT (" and may render the program nonresponsive.\n " ) +
1120+ wxT (" Do you wish to continue?" ),
1121+ _ (" Large strategic game warning" ), wxOK | wxCANCEL | wxALIGN_CENTER,
1122+ this ) != wxOK) {
11221123 return ;
11231124 }
11241125 }
@@ -1242,15 +1243,16 @@ void GameFrame::OnToolsEquilibrium(wxCommandEvent &)
12421243
12431244 if (dialog.ShowModal () == wxID_OK) {
12441245 if (dialog.UseStrategic ()) {
1245- const int ncont = m_doc->GetGame ()->NumStrategyContingencies ();
1246- if (ncont >= 50000 ) {
1247- if (wxMessageBox (wxString::Format (
1248- wxT (" This game has %d contingencies in strategic form.\n " ), ncont) +
1249- wxT (" Performance in solving strategic form will be poor,\n " ) +
1250- wxT (" and may render the program nonresponsive.\n " ) +
1251- wxT (" Do you wish to continue?" ),
1252- _ (" Large strategic game warning" ), wxOK | wxCANCEL | wxALIGN_CENTER,
1253- this ) != wxOK) {
1246+ if (const int contingencies = m_doc->GetGame ()->GetStrategies ().extent_product ();
1247+ contingencies >= 50000 ) {
1248+ if (wxMessageBox (
1249+ wxString::Format (wxT (" This game has %d contingencies in strategic form.\n " ),
1250+ contingencies) +
1251+ wxT (" Performance in solving strategic form will be poor,\n " ) +
1252+ wxT (" and may render the program nonresponsive.\n " ) +
1253+ wxT (" Do you wish to continue?" ),
1254+ _ (" Large strategic game warning" ), wxOK | wxCANCEL | wxALIGN_CENTER,
1255+ this ) != wxOK) {
12541256 return ;
12551257 }
12561258 }
0 commit comments