Skip to content

Commit

Permalink
use Array.Empty<object>()
Browse files Browse the repository at this point in the history
  • Loading branch information
ZjzMisaka committed Nov 6, 2023
1 parent acd8d18 commit f700cd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PowerThreadPool/PowerThreadPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public string QueueWorkItem(Action action, Action<ExecuteResult<object>> callBac
{
WorkOption option = new WorkOption();
option.Callback = callBack;
return QueueWorkItem<object>(DelegateHelper<object>.ToNormalFunc(action), new object[0], option);
return QueueWorkItem<object>(DelegateHelper<object>.ToNormalFunc(action), Array.Empty<object>(), option);
}

/// <summary>
Expand All @@ -150,7 +150,7 @@ public string QueueWorkItem(Action action, Action<ExecuteResult<object>> callBac
/// <returns>work id</returns>
public string QueueWorkItem(Action action, WorkOption option)
{
return QueueWorkItem<object>(DelegateHelper<object>.ToNormalFunc(action), new object[0], option);
return QueueWorkItem<object>(DelegateHelper<object>.ToNormalFunc(action), Array.Empty<object>(), option);
}

/// <summary>
Expand Down Expand Up @@ -562,7 +562,7 @@ public string QueueWorkItem<TResult>(Func<TResult> function, Action<ExecuteResul
{
WorkOption<TResult> option = new WorkOption<TResult>();
option.Callback = callBack;
return QueueWorkItem<TResult>(DelegateHelper<TResult>.ToNormalFunc(function), new object[] { }, option);
return QueueWorkItem<TResult>(DelegateHelper<TResult>.ToNormalFunc(function), Array.Empty<object>(), option);
}

/// <summary>
Expand All @@ -574,7 +574,7 @@ public string QueueWorkItem<TResult>(Func<TResult> function, Action<ExecuteResul
/// <returns>work id</returns>
public string QueueWorkItem<TResult>(Func<TResult> function, WorkOption<TResult> option)
{
return QueueWorkItem<TResult>(DelegateHelper<TResult>.ToNormalFunc(function), new object[] { }, option);
return QueueWorkItem<TResult>(DelegateHelper<TResult>.ToNormalFunc(function), Array.Empty<object>(), option);
}

/// <summary>
Expand Down

0 comments on commit f700cd0

Please sign in to comment.