diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index cacef845..ee759db0 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -1791,8 +1791,14 @@ namespace WebSocketSharp /// public static void Times (this int n, Action action) { - if (n > 0 && action != null) - ((ulong) n).times (action); + if (n <= 0) + return; + + if (action == null) + return; + + for (int i = 0; i < n; i++) + action (); } ///