Skip to content

Commit

Permalink
redundant methods
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jun 12, 2022
1 parent a567647 commit e1a6605
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
17 changes: 0 additions & 17 deletions src/Verify/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@ public static List<T> Clone<T>(this List<T> original) =>
public static bool IsException(this Type type) =>
typeof(Exception).IsAssignableFrom(type);

public static string FullName(this MethodInfo method) =>
$"{method.ReflectedType!.Name}.{method.Name}";

public static bool IsEmpty<T>(this IReadOnlyCollection<T> target) =>
!target.Any();

public static TValue GetOrAdd<TKey, TValue>(
this Dictionary<TKey, TValue> dictionary,
TKey key,
Func<TKey, TValue> valueFunc)
where TKey : notnull
{
if (dictionary.TryGetValue(key, out var value))
{
return value;
}

return dictionary[key] = valueFunc(key);
}
}
1 change: 1 addition & 0 deletions src/Verify/Serialization/Converters/ValueTaskConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public override void Write(VerifyJsonWriter writer, object value)
writer.WriteEndObject();
}

// ReSharper disable once UnusedMember.Local
static void WriteGeneric<T>(VerifyJsonWriter writer, ValueTask<T> task)
{
writer.WriteProperty(task, task.IsCanceled, "IsCanceled");
Expand Down

0 comments on commit e1a6605

Please sign in to comment.