Skip to content

Commit d52b2da

Browse files
committed
Convert no longer necessary lambda expressions to method groups
1 parent baf865f commit d52b2da

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

osu.Framework/Extensions/TypeExtensions/TypeExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ public static Type GetUnderlyingNullableType(this Type type)
116116
if (!type.IsGenericType)
117117
return null;
118118

119-
// ReSharper disable once ConvertClosureToMethodGroup (see: https://github.com/dotnet/runtime/issues/33747)
120-
return underlying_type_cache.GetOrAdd(type, t => Nullable.GetUnderlyingType(t));
119+
return underlying_type_cache.GetOrAdd(type, Nullable.GetUnderlyingType);
121120
}
122121

123122
/// <summary>

osu.Framework/Input/Bindings/KeyBindingContainer.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,9 @@ private bool handleNewPressed(InputState state, InputKey newKey, Vector2? scroll
232232
if (KeyCombination.IsModifierKey(newKey))
233233
{
234234
// if the current key pressed was a modifier, only handle modifier-only bindings.
235-
// lambda expression is used so that the delegate is cached (see: https://github.com/dotnet/roslyn/issues/5835)
236-
// TODO: remove when we switch to .NET 7.
237-
// ReSharper disable once ConvertClosureToMethodGroup
238235
for (int i = 0; i < newlyPressed.Count; i++)
239236
{
240-
if (!newlyPressed[i].KeyCombination.Keys.All(key => KeyCombination.IsModifierKey(key)))
237+
if (!newlyPressed[i].KeyCombination.Keys.All(KeyCombination.IsModifierKey))
241238
newlyPressed.RemoveAt(i--);
242239
}
243240
}

osu.Framework/Platform/Windows/WindowsMouseHandler_SDL2.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ internal partial class WindowsMouseHandler
2727

2828
private void initialiseSDL2(GameHost host)
2929
{
30-
// ReSharper disable once ConvertClosureToMethodGroup
31-
sdl2Callback = (ptr, wnd, u, param, l) => onWndProcSDL2(ptr, wnd, u, param, l);
30+
sdl2Callback = onWndProcSDL2;
3231

3332
Enabled.BindValueChanged(enabled =>
3433
{

0 commit comments

Comments
 (0)