1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +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;
switch (event.key()) {
case Key_A:
[[fallthrough]];
case Key_Left:
m_paddle.moving_left = false;
break;
case Key_D:
[[fallthrough]];
case Key_Right:
m_paddle.moving_right = false;
break;
@ -174,10 +176,12 @@ void Game::keydown_event(GUI::KeyEvent& event)
GUI::Application::the()->quit();
break;
case Key_A:
[[fallthrough]];
case Key_Left:
m_paddle.moving_left = true;
break;
case Key_D:
[[fallthrough]];
case Key_Right:
m_paddle.moving_right = true;
break;