internal static string[] Compose(ICollection<string> template, IEnumerable<KeyValuePair<string, string>> placeholders) { var operation = new ArrayOperationWithValue(placeholders, template.Count); Parallel.ForEach(template, operation.ParallelLoopBody); return operation.GetResult() as string[]; }
internal static string[] Compose(string[] template, int offset, int count, IEnumerable<KeyValuePair<string, string>> placeholders) { var segment = new ArraySegment<string>(template, offset, count); var operation = new ArrayOperationWithValue(placeholders, count); Parallel.ForEach(segment, operation.ParallelLoopBody); return operation.GetResult() as string[]; }