Simplification when using C++20

This commit is contained in:
Adrian Conlon 2021-12-08 19:52:53 +00:00
parent e8dd92f0ae
commit 19f8e20021

View File

@ -181,7 +181,7 @@ void Game::addJoystick(SDL_Event& e) {
auto controller = std::make_shared<GameController>(which);
const auto joystickId = controller->getJoystickId();
m_gameControllers[which] = controller;
SDL_assert(m_mappedControllers.find(joystickId) == m_mappedControllers.end());
SDL_assert(m_mappedControllers.contains(joystickId));
m_mappedControllers[joystickId] = which;
SDL_Log("Joystick device %d added (%zd controllers)", which, m_gameControllers.size());
}