Skip to content

Commit 6d4f81a

Browse files
Merge pull request #23 from thomaslevesque/remove-compat-methods
Remove compat methods
2 parents f85700f + 4a148b7 commit 6d4f81a

16 files changed

+53
-4302
lines changed

Linq.Extras.ndproj

Lines changed: 0 additions & 4097 deletions
This file was deleted.

Linq.Extras.sln

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,4 @@ Global
5757
GlobalSection(ExtensibilityGlobals) = postSolution
5858
SolutionGuid = {1AC5F1E6-BC9A-4EB9-BFD3-7F548BC6F652}
5959
EndGlobalSection
60-
GlobalSection(NDepend) = preSolution
61-
Project = ".\Linq.Extras.ndproj"
62-
EndGlobalSection
6360
EndGlobal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
A set of extension and helper methods to complement the ones from `System.Linq.Enumerable`.
1010

11-
Some of these methods are just shortcuts for common Linq operations (e.g. `Append`, `IsNullOrEmpty`), or improvements to
11+
Some of these methods are just shortcuts for common Linq operations (e.g. `IsNullOrEmpty`), or improvements to
1212
existing Linq methods (e.g. specify default value for `FirstOrDefault`, specify comparer for `Max`). Others do more
1313
complex things that have no equivalent in standard Linq (`RankBy`, `DistinctUntilChanged`).
1414

src/Linq.Extras/AppendPrepend.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Linq.Extras/Flatten.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private static IEnumerable<TResult> DepthFirstFlattenIterator<TNode, TResult>(th
102102
var list = source.Select(n => new NodeWithLevel<TNode>(n, 0)).ToLinkedList();
103103
while (list.Count > 0)
104104
{
105-
var current = list.First.Value;
105+
var current = list.First!.Value;
106106
list.RemoveFirst();
107107
yield return resultSelector(current.Node, current.Level);
108108
var llNode = list.First;

src/Linq.Extras/Internal/ExcludeFromCodeCoverageAttribute.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Linq.Extras/Linq.Extras.csproj

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5-
<TargetFrameworks>netstandard1.0;netstandard1.6;netstandard2.0;netstandard2.1;net45;net471;net472;netcoreapp2.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;netstandard2.1;net45;netcoreapp3.1;net5.0</TargetFrameworks>
66
<Description>A set of helper and extension methods to complement the System.Linq namespace.</Description>
77
<Authors>Thomas Levesque</Authors>
88
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
@@ -15,7 +15,7 @@
1515
<AssemblyOriginatorKeyFile>..\..\Linq.Extras.snk</AssemblyOriginatorKeyFile>
1616
<SignAssembly>true</SignAssembly>
1717
<MinVerVerbosity>quiet</MinVerVerbosity>
18-
<LangVersion>8.0</LangVersion>
18+
<LangVersion>latest</LangVersion>
1919
<Nullable>enable</Nullable>
2020
</PropertyGroup>
2121

@@ -24,35 +24,16 @@
2424
<PackageReference Include="MinVer" Version="2.3.0" PrivateAssets="All" />
2525
</ItemGroup>
2626

27-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.0'">
28-
</PropertyGroup>
29-
30-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
31-
<DefineConstants>$(DefineConstants);FEATURE_APPEND_PREPEND</DefineConstants>
32-
</PropertyGroup>
33-
34-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
35-
<DefineConstants>$(DefineConstants);FEATURE_APPEND_PREPEND;FEATURE_ExcludeFromCodeCoverageAttribute</DefineConstants>
36-
</PropertyGroup>
37-
3827
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
39-
<DefineConstants>$(DefineConstants);FEATURE_APPEND_PREPEND;FEATURE_TO_HASHSET;FEATURE_NULLABILITY_ATTRIBUTES;FEATURE_ExcludeFromCodeCoverageAttribute</DefineConstants>
40-
</PropertyGroup>
41-
42-
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
43-
<DefineConstants>$(DefineConstants);FEATURE_ExcludeFromCodeCoverageAttribute</DefineConstants>
44-
</PropertyGroup>
45-
46-
<PropertyGroup Condition="'$(TargetFramework)' == 'net471'">
47-
<DefineConstants>$(DefineConstants);FEATURE_APPEND_PREPEND;FEATURE_ExcludeFromCodeCoverageAttribute</DefineConstants>
28+
<DefineConstants>$(DefineConstants);FEATURE_NULLABILITY_ATTRIBUTES</DefineConstants>
4829
</PropertyGroup>
4930

50-
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
51-
<DefineConstants>$(DefineConstants);FEATURE_APPEND_PREPEND;FEATURE_TO_HASHSET;FEATURE_ExcludeFromCodeCoverageAttribute</DefineConstants>
31+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
32+
<DefineConstants>$(DefineConstants);FEATURE_NULLABILITY_ATTRIBUTES;FEATURE_COMPARER_NULLABILITY</DefineConstants>
5233
</PropertyGroup>
5334

54-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
55-
<DefineConstants>$(DefineConstants);FEATURE_APPEND_PREPEND;FEATURE_TO_HASHSET;FEATURE_ExcludeFromCodeCoverageAttribute</DefineConstants>
35+
<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0'">
36+
<DefineConstants>$(DefineConstants);FEATURE_NULLABILITY_ATTRIBUTES;FEATURE_COMPARER_NULLABILITY</DefineConstants>
5637
</PropertyGroup>
5738

5839
</Project>

src/Linq.Extras/OuterJoin.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static IEnumerable<TResult> LeftOuterJoin<TLeft, TRight, TKey, TResult>(
3232
[NotNull] Func<TLeft, TKey> leftKeySelector,
3333
[NotNull] Func<TRight, TKey> rightKeySelector,
3434
[NotNull] Func<TLeft, TRight, TResult> resultSelector,
35-
TRight defaultRight = default,
35+
TRight defaultRight = default!,
3636
IEqualityComparer<TKey>? keyComparer = null)
3737
{
3838
left.CheckArgumentNull(nameof(left));
@@ -72,7 +72,7 @@ public static IEnumerable<TResult> RightOuterJoin<TLeft, TRight, TKey, TResult>(
7272
[NotNull] Func<TLeft, TKey> leftKeySelector,
7373
[NotNull] Func<TRight, TKey> rightKeySelector,
7474
[NotNull] Func<TLeft, TRight, TResult> resultSelector,
75-
TLeft defaultLeft = default,
75+
TLeft defaultLeft = default!,
7676
IEqualityComparer<TKey>? keyComparer = null)
7777
{
7878
left.CheckArgumentNull(nameof(left));
@@ -112,8 +112,8 @@ public static IEnumerable<TResult> FullOuterJoin<TLeft, TRight, TKey, TResult>(
112112
[NotNull] Func<TLeft, TKey> leftKeySelector,
113113
[NotNull] Func<TRight, TKey> rightKeySelector,
114114
[NotNull] Func<TKey, TLeft, TRight, TResult> resultSelector,
115-
TLeft defaultLeft = default,
116-
TRight defaultRight = default,
115+
TLeft defaultLeft = default!,
116+
TRight defaultRight = default!,
117117
IEqualityComparer<TKey>? keyComparer = null)
118118
{
119119
left.CheckArgumentNull(nameof(left));

src/Linq.Extras/ToCollections.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,6 @@ public static Stack<TSource> ToStack<TSource>([NotNull] this IEnumerable<TSource
3434
return new Stack<TSource>(source);
3535
}
3636

37-
#if !FEATURE_TO_HASHSET
38-
/// <summary>
39-
/// Creates a hash set from the elements in the source sequence.
40-
/// </summary>
41-
/// <typeparam name="TSource">The type of the elements of <c>source</c>.</typeparam>
42-
/// <param name="source">The sequence containing the elements to put in the hash set.</param>
43-
/// <param name="comparer">A comparer to test for equality between elements.</param>
44-
/// <returns>A hash set containing the same elements as the <c>source</c> sequence.</returns>
45-
/// <remarks>Since a hash set cannot contain duplicates, duplicate elements from the <c>source</c> sequence will not be included in the hash set.</remarks>
46-
[Pure]
47-
public static HashSet<TSource> ToHashSet<TSource>([NotNull] this IEnumerable<TSource> source, IEqualityComparer<TSource>? comparer = null)
48-
{
49-
source.CheckArgumentNull(nameof(source));
50-
return new HashSet<TSource>(source, comparer);
51-
}
52-
#endif
53-
5437
/// <summary>
5538
/// Creates a linked list from the elements in the source sequence.
5639
/// </summary>

src/Linq.Extras/ToHierarchy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static IEnumerable<INode<TSource>> ToHierarchy<TSource, TId>(
2323
[NotNull] this IEnumerable<TSource> source,
2424
[NotNull] Func<TSource, TId> idSelector,
2525
[NotNull] Func<TSource, TId> parentIdSelector,
26-
TId rootParentId = default)
26+
TId rootParentId = default!)
2727
{
2828
source.CheckArgumentNull(nameof(source));
2929
idSelector.CheckArgumentNull(nameof(idSelector));

0 commit comments

Comments
 (0)