Rename some type parameters to be more descriptive

This commit is contained in:
Matt Nadareski
2026-07-09 09:55:39 -04:00
parent 6045830bbb
commit bf4c6bf703
4 changed files with 9 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ namespace SabreTools.Collections.Extensions
/// .NET Frameworks 2.0 and 3.5 process in series.
/// .NET Frameworks 4.0 onward process in parallel.
/// </remarks>
public static void IterateWithAction<T>(this IEnumerable<T> source, Action<T> action)
public static void IterateWithAction<TValue>(this IEnumerable<TValue> source, Action<TValue> action)
{
#if NET20 || NET35
foreach (var item in source)
@@ -27,10 +27,10 @@ namespace SabreTools.Collections.Extensions
/// <summary>
/// Safely iterate through an enumerable, skipping any errors
/// </summary>
public static IEnumerable<T> SafeEnumerate<T>(this IEnumerable<T> enumerable)
public static IEnumerable<TValue> SafeEnumerate<TValue>(this IEnumerable<TValue> enumerable)
{
// Get the enumerator for the enumerable
IEnumerator<T> enumerator;
IEnumerator<TValue> enumerator;
try
{
enumerator = enumerable.GetEnumerator();

View File

@@ -3,11 +3,11 @@
/// <summary>
/// Represents a matcher for a particular type
/// </summary>
public interface IMatch<T>
public interface IMatch<TNeedle>
{
/// <summary>
/// Nullable typed data to be matched
/// </summary>
public T? Needle { get; }
public TNeedle? Needle { get; }
}
}

View File

@@ -5,12 +5,12 @@ namespace SabreTools.Matching
/// <summary>
/// Wrapper for a single set of matching criteria
/// </summary>
public interface IMatchSet<T, U> where T : IMatch<U>
public interface IMatchSet<TMatcher, TNeedle> where TMatcher : IMatch<TNeedle>
{
/// <summary>
/// Set of all matchers
/// </summary>
public List<T> Matchers { get; }
public List<TMatcher> Matchers { get; }
/// <summary>
/// Unique name for the match set

View File

@@ -6,8 +6,8 @@ This library contains classes designed to make matching contents and paths easie
| Interface | Notes |
| --- | --- |
| `IMatch<T>` | Represents a matcher for a generic type |
| `IMatchSet<T, U>` | Represents a set of `IMatch<T>` types |
| `IMatch<TNeedle>` | Represents a matcher for a generic type |
| `IMatchSet<TMatcher, TNeedle>` | Represents a set of `IMatch<TNeedle>` types |
## Matching Classes