diff --git a/60 Mastermind/csharp/Game/src/Controller.cs b/60 Mastermind/csharp/Game/src/Controller.cs
index 389203b0..85a41f9f 100644
--- a/60 Mastermind/csharp/Game/src/Controller.cs
+++ b/60 Mastermind/csharp/Game/src/Controller.cs
@@ -102,7 +102,7 @@ namespace Game
if (input.FindFirstIndex(c => !TranslateColor(c).HasValue) is int invalidPosition)
View.NotifyInvalidColor(input[invalidPosition]);
else
- return (Command.MakeGuess, new Code(input.SelectNonNull(TranslateColor)));
+ return (Command.MakeGuess, new Code(input.Select(c => TranslateColor(c)!.Value)));
break;
}
diff --git a/60 Mastermind/csharp/Game/src/EnumerableExtensions.cs b/60 Mastermind/csharp/Game/src/EnumerableExtensions.cs
index c235ffa7..3bd6cf96 100644
--- a/60 Mastermind/csharp/Game/src/EnumerableExtensions.cs
+++ b/60 Mastermind/csharp/Game/src/EnumerableExtensions.cs
@@ -84,28 +84,5 @@ namespace Game
return defaultValue;
}
-
- ///
- /// Maps the values of the source sequence to a nullable type and
- /// returns the non-null values.
- ///
- ///
- /// The type of elements in the source sequence.
- ///
- ///
- /// The source sequence.
- ///
- ///
- /// The selector function.
- ///
- public static IEnumerable SelectNonNull(this IEnumerable source, Func selector) where TResult: struct
- {
- foreach (var element in source)
- {
- var result = selector(element);
- if (result.HasValue)
- yield return result.Value;
- }
- }
}
}