mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 16:28:54 +00:00
Breakout: Tag fallthrough statement
Tag key changes with fallthrough statement to document the intention.
This commit is contained in:
parent
ef3f9b24dd
commit
567104607c
Notes:
sideshowbarker
2024-07-18 03:56:29 +09:00
Author: https://github.com/orpheustaken
Commit: 567104607c
Pull-request: https://github.com/SerenityOS/serenity/pull/10034
Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue