Improve fixed code

This commit is contained in:
Huo Yaoyuan
2024-11-28 12:20:48 +08:00
parent ab9552b4cd
commit a80a4bea40
2 changed files with 3 additions and 5 deletions

View File

@@ -545,11 +545,10 @@ namespace osu.Framework.Graphics.UserInterface
private void updateChildIfNeeded(TabItem<T> child, bool isVisible)
{
if (!tabVisibility.TryGetValue(child, out bool value) || value != isVisible)
if (!tabVisibility.TryGetValue(child, out bool currentVisibility) || currentVisibility != isVisible)
{
TabVisibilityChanged?.Invoke(child, isVisible);
value = isVisible;
tabVisibility[child] = value;
tabVisibility[child] = isVisible;
if (isVisible)
child.Show();

View File

@@ -182,10 +182,9 @@ namespace osu.Framework.Input.Handlers.Midi
// need running status to be interpreted correctly
if (statusType <= 0x7F)
{
if (!runningStatus.TryGetValue(senderId, out byte value))
if (!runningStatus.TryGetValue(senderId, out eventType))
throw new InvalidDataException($"Received running status of sender {senderId}, but no event type was stored");
eventType = value;
key = statusType;
velocity = data[i++];
return;