Use better code
This commit is contained in:
parent
608e7a99bc
commit
75c8a8ced4
32 changed files with 77 additions and 105 deletions
|
|
@ -26,8 +26,8 @@ namespace TShockAPI
|
|||
{
|
||||
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
|
||||
{
|
||||
if (source == null) throw new ArgumentNullException("source");
|
||||
if (action == null) throw new ArgumentNullException("action");
|
||||
ArgumentNullException.ThrowIfNull(source);
|
||||
ArgumentNullException.ThrowIfNull(action);
|
||||
|
||||
foreach (T item in source)
|
||||
action(item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue