Skip to content

Commit 70067ba

Browse files
committed
cleanup
1 parent 1c858e0 commit 70067ba

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Verify/Serialization/ReflectionHelpers.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ static bool ImplementsIEnumerable(this Type interfaceType)
5454
return typeof(IEnumerable).IsAssignableFrom(interfaceType);
5555
}
5656

57+
public static bool IsCollectionOrDictionary(this Type type)
58+
{
59+
return type.IsCollection() ||
60+
type.IsDictionary();
61+
}
62+
5763
public static bool IsCollection(this Type type)
5864
{
5965
if (type == typeof(string))

src/Verify/Serialization/SerializationSettings_Ignore.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ internal bool TryGetShouldSerialize(Type memberType, Func<object, object?> getVa
271271

272272
bool IsIgnoredCollection(Type memberType)
273273
{
274-
return ignoreEmptyCollections &&
275-
memberType.IsCollection() ||
276-
memberType.IsDictionary();
274+
return ignoreEmptyCollections &&
275+
memberType.IsCollectionOrDictionary();
277276
}
278277
}

0 commit comments

Comments
 (0)