Removed unnecessary nullable type in maxBy (#181)
* Removed unnecessary nullable type in maxBy
* Update functions_test.dart
diff --git a/lib/src/functions.dart b/lib/src/functions.dart
index 8e73f16..ec5f5d8 100644
--- a/lib/src/functions.dart
+++ b/lib/src/functions.dart
@@ -86,7 +86,7 @@
/// compared using their [Comparable.compareTo].
///
/// Returns `null` if [values] is empty.
-S? maxBy<S, T>(Iterable<S> values, T Function(S?) orderBy,
+S? maxBy<S, T>(Iterable<S> values, T Function(S) orderBy,
{int? Function(T, T)? compare}) {
compare ??= defaultCompare;
diff --git a/test/functions_test.dart b/test/functions_test.dart
index cffd233..3247c69 100644
--- a/test/functions_test.dart
+++ b/test/functions_test.dart
@@ -162,7 +162,7 @@
{'foo': 4},
{'foo': 1},
{'foo': 2}
- ], (map) => map!,
+ ], (map) => map,
compare: (map1, map2) => map1['foo']!.compareTo(map2['foo']!)),
equals({'foo': 5}));
});