1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:07:45 +00:00

Breakout: Tag fallthrough statement

Tag key changes with fallthrough statement to document the intention.
This commit is contained in:
Matheus Vinicius 2021-09-15 04:22:35 -03:00 committed by Brian Gianforcaro
parent ef3f9b24dd
commit 567104607c

View file

@ -153,10 +153,12 @@ void Game::keyup_event(GUI::KeyEvent& event)
return; return;
switch (event.key()) { switch (event.key()) {
case Key_A: case Key_A:
[[fallthrough]];
case Key_Left: case Key_Left:
m_paddle.moving_left = false; m_paddle.moving_left = false;
break; break;
case Key_D: case Key_D:
[[fallthrough]];
case Key_Right: case Key_Right:
m_paddle.moving_right = false; m_paddle.moving_right = false;
break; break;
@ -174,10 +176,12 @@ void Game::keydown_event(GUI::KeyEvent& event)
GUI::Application::the()->quit(); GUI::Application::the()->quit();
break; break;
case Key_A: case Key_A:
[[fallthrough]];
case Key_Left: case Key_Left:
m_paddle.moving_left = true; m_paddle.moving_left = true;
break; break;
case Key_D: case Key_D:
[[fallthrough]];
case Key_Right: case Key_Right:
m_paddle.moving_right = true; m_paddle.moving_right = true;
break; break;