Skip to content

Commit cdf5d8a

Browse files
committed
Fix conflict with Append; remove polyfill and use Concat
1 parent 515f32e commit cdf5d8a

2 files changed

Lines changed: 1 addition & 24 deletions

File tree

src/Lucene.Net/Store/MMapDirectory.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,7 @@ private static void DisposeResourcesWhileHandlingException(Exception? priorExcep
630630
// With leaveOpen: true we always own fs; dispose mmf first after chunks so the mapping is torn down
631631
// before the backing handle closes.
632632
var disposables = ((SCG.IEnumerable<IDisposable?>)(chunks ?? []))
633-
.Append(mmf)
634-
.Append(fs);
633+
.Concat([mmf, fs]);
635634

636635
// DisposeWhileHandlingException tolerates null disposables
637636
IOUtils.DisposeWhileHandlingException(priorException, disposables);

src/Lucene.Net/Support/EnumerableExtensions.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Runtime.CompilerServices;
43

54
namespace Lucene.Net.Support
65
{
@@ -119,26 +118,5 @@ private static IEnumerable<T> TakeAllButLastImpl<T>(IEnumerable<T> source, int n
119118
yield return buffer.Dequeue();
120119
}
121120
}
122-
123-
#if !FEATURE_IENUMERABLE_APPEND
124-
/// <summary>
125-
/// Appends a value to the end of the sequence.
126-
/// </summary>
127-
/// <param name="source">The source sequence.</param>
128-
/// <param name="element">The element to append.</param>
129-
/// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
130-
/// <returns>A new sequence that ends with <paramref name="element"/>.</returns>
131-
/// <exception cref="ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
132-
public static IEnumerable<T> Append<T>(this IEnumerable<T> source, T element)
133-
{
134-
if (source is null)
135-
throw new ArgumentNullException(nameof(source));
136-
137-
foreach (T x in source)
138-
yield return x;
139-
140-
yield return element;
141-
}
142-
#endif
143121
}
144122
}

0 commit comments

Comments
 (0)