Skip to content

Commit

Permalink
Adjust preprocessors (#44)
Browse files Browse the repository at this point in the history
This picks the best overloads for more TFMs.

And uses `string.Contains(string)` instead of
`IEnumerable<char>.Contains(char)` for older TFMs.
  • Loading branch information
jnyrup authored Dec 30, 2024
1 parent 8ca99aa commit 108942c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Reflectify/Reflectify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static bool IsTuple(this Type type)
return false;
}

#if !(NET47 || NETSTANDARD2_0)
#if NETCOREAPP2_0_OR_GREATER || NET471_OR_GREATER || NETSTANDARD2_1_OR_GREATER
return typeof(ITuple).IsAssignableFrom(type);
#else
Type openType = type.GetGenericTypeDefinition();
Expand Down Expand Up @@ -524,10 +524,10 @@ public static bool IsIndexer(this PropertyInfo member)
/// </summary>
public static bool IsExplicitlyImplemented(this PropertyInfo prop)
{
#if NETCOREAPP3_0_OR_GREATER
return prop.Name.Contains('.', StringComparison.OrdinalIgnoreCase);
#else
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
return prop.Name.Contains('.');
#else
return prop.Name.IndexOf('.') != -1;
#endif
}

Expand Down

0 comments on commit 108942c

Please sign in to comment.