diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index a63d9293bf..240c7976fe 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -567,8 +567,9 @@ void Pcsx2App::OnEmuKeyDown( wxKeyEvent& evt ) const GlobalCommandDescriptor* cmd = NULL; if (GlobalAccels) { - if (GlobalAccels->find(KeyAcceleratorCode(evt).val32) != GlobalAccels->end()) - cmd = GlobalAccels->at(KeyAcceleratorCode(evt).val32); + std::unordered_map::const_iterator iter(GlobalAccels->find(KeyAcceleratorCode(evt).val32)); + if (iter != GlobalAccels->end()) + cmd = iter->second; } if( cmd == NULL ) diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index c9ff575ed8..9c220b0a12 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -294,10 +294,11 @@ void GSPanel::DirectKeyCommand( const KeyAcceleratorCode& kac ) { const GlobalCommandDescriptor* cmd = NULL; - if (m_Accels->find(kac.val32) == m_Accels->end()) + std::unordered_map::const_iterator iter(m_Accels->find(kac.val32)); + if (iter == m_Accels->end()) return; - cmd = m_Accels->at(kac.val32); + cmd = iter->second; DbgCon.WriteLn( "(gsFrame) Invoking command: %s", cmd->Id ); cmd->Invoke(); diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index 17da9f13d0..28adc033b4 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -545,8 +545,9 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *s const GlobalCommandDescriptor* result = NULL; - if (find(acode.val32) != end()) - result = at(acode.val32); + std::unordered_map::const_iterator iter(find(acode.val32)); + if (iter != end()) + result = iter->second; if( result != NULL ) { @@ -557,8 +558,10 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *s ); } - if (wxGetApp().GlobalCommands->find(searchfor) != wxGetApp().GlobalCommands->end()) - result = wxGetApp().GlobalCommands->at(searchfor); + std::unordered_map::const_iterator acceleratorIter(wxGetApp().GlobalCommands->find(searchfor)); + + if (acceleratorIter != wxGetApp().GlobalCommands->end()) + result = acceleratorIter->second; if( result == NULL ) {