Replace try-finally with return

Try-finally has a small overhead that's unnecessary in this case given
how small the code block is.
This commit is contained in:
Dan Balasescu 2024-08-05 13:28:42 +09:00
parent 419d5a76ce
commit 20b890570e
No known key found for this signature in database

View File

@ -174,14 +174,9 @@ namespace osu.Game.Rulesets.Osu.UI
public bool OnPressed(KeyBindingPressEvent<OsuAction> e)
{
try
{
return BlockNextPress;
}
finally
{
BlockNextPress = false;
}
bool block = BlockNextPress;
BlockNextPress = false;
return block;
}
public void OnReleased(KeyBindingReleaseEvent<OsuAction> e)