diff Implab/Parallels/ArrayTraits.cs @ 101:279e226dffdd v2

code cleanup added EnsureDispatched extension
author cin
date Thu, 06 Nov 2014 20:03:19 +0300
parents 4c0e5ef99986
children 5f10d54b45df
line wrap: on
line diff
--- a/Implab/Parallels/ArrayTraits.cs	Wed Nov 05 16:39:56 2014 +0300
+++ b/Implab/Parallels/ArrayTraits.cs	Thu Nov 06 20:03:19 2014 +0300
@@ -1,9 +1,6 @@
 using Implab.Diagnostics;
 using System;
-using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq;
-using System.Text;
 using System.Threading;
 
 namespace Implab.Parallels {
@@ -146,13 +143,13 @@
             return iter.Promise;
         }
 
-        public static IPromise<TDst[]> ChainedMap<TSrc, TDst>(this TSrc[] source, ResultMapper<TSrc, IPromise<TDst>> transform, int threads) {
+        public static IPromise<TDst[]> ChainedMap<TSrc, TDst>(this TSrc[] source, Func<TSrc, IPromise<TDst>> transform, int threads) {
             if (source == null)
                 throw new ArgumentNullException("source");
             if (transform == null)
                 throw new ArgumentNullException("transform");
             if (threads <= 0)
-                throw new ArgumentOutOfRangeException("Threads number must be greater then zero");
+                throw new ArgumentOutOfRangeException("threads","Threads number must be greater then zero");
 
             if (source.Length == 0)
                 return Promise<TDst[]>.ResultToPromise(new TDst[0]);