Skip to content

Commit dbefc6b

Browse files
committed
Remove some C#6 features, fixes the build
1 parent 75b02d7 commit dbefc6b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/Shared/Extensions/CollectionEqualityExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public static bool CollectionEquals<TValue>(this IDictionary<string, TValue> sou
5151
}
5252

5353
public static int GetCollectionHashCode<T>(this IEnumerable<T> source) {
54-
int hashCode = typeof(T).AssemblyQualifiedName?.GetHashCode() ?? 0;
54+
var assemblyQualifiedName = typeof(T).AssemblyQualifiedName;
55+
int hashCode = assemblyQualifiedName == null ? 0 : assemblyQualifiedName.GetHashCode();
5556

5657
foreach (var item in source) {
5758
if(item == null) continue;
@@ -65,8 +66,8 @@ public static int GetCollectionHashCode<T>(this IEnumerable<T> source) {
6566

6667
public static int GetCollectionHashCode<TValue>(this IDictionary<string, TValue> source)
6768
{
68-
69-
int hashCode = typeof(TValue).AssemblyQualifiedName?.GetHashCode() ?? 0;
69+
var assemblyQualifiedName = typeof(TValue).AssemblyQualifiedName;
70+
int hashCode = assemblyQualifiedName == null ? 0 : assemblyQualifiedName.GetHashCode();
7071

7172
var keyValuePairHashes = new List<int>(source.Keys.Count);
7273

0 commit comments

Comments
 (0)