BadScript 2
Loading...
Searching...
No Matches
PartitionExtensions.cs
Go to the documentation of this file.
1
// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3
using
System;
4
using
System.Collections.Generic;
5
6
namespace
CommandLine.Core
7
{
8
internal
static
class
PartitionExtensions
9
{
10
public
static
Tuple<IEnumerable<T>, IEnumerable<T>>
PartitionByPredicate<T>
(
this
IEnumerable<T> items,
11
Func<T, bool> pred)
12
{
13
List<T> yes =
new
List<T>();
14
List<T> no =
new
List<T>();
15
16
foreach
(T item
in
items)
17
{
18
List<T> list = pred(item) ? yes : no;
19
list.Add(item);
20
}
21
22
return
Tuple.Create<IEnumerable<T>, IEnumerable<T>>(yes, no);
23
}
24
}
25
}
CommandLine.Core.PartitionExtensions
Definition
PartitionExtensions.cs:9
CommandLine.Core.PartitionExtensions.PartitionByPredicate< T >
static Tuple< IEnumerable< T >, IEnumerable< T > > PartitionByPredicate< T >(this IEnumerable< T > items, Func< T, bool > pred)
Definition
PartitionExtensions.cs:10
CommandLine.Core
Definition
ArgumentsExtensions.cs:10
deps
commandlineparser
src
CommandLine
Core
PartitionExtensions.cs
Generated by
1.9.8