[Modify] Polish it

This commit is contained in:
sta 2019-09-17 19:39:46 +09:00
parent 7a0b0db285
commit 2bde8d4d68

View File

@ -1897,9 +1897,14 @@ namespace WebSocketSharp
/// </param> /// </param>
public static void Times (this long n, Action<long> action) public static void Times (this long n, Action<long> action)
{ {
if (n > 0 && action != null) if (n <= 0)
for (long i = 0; i < n; i++) return;
action (i);
if (action == null)
return;
for (long i = 0; i < n; i++)
action (i);
} }
/// <summary> /// <summary>