Skip to content

Commit 1b54c83

Browse files
committed
[BCL] improve #if for ListLayout and DictionaryLayout.
Should fix net6.0 usage.
1 parent 233f2a4 commit 1b54c83

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/StructLinq/Dictionary/DictionaryLayout.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,32 @@ internal class DictionaryLayout<TKey, TValue>
77
public Entry<TKey, TValue>[] Entries;
88
}
99

10-
#if (NETCOREAPP3_0 || NETCOREAPP3_1)
10+
#if (NET5_0_OR_GREATER)
1111

1212
internal struct Entry<TKey, TValue>
1313
{
14-
public int Next;
1514
public uint HashCode;
15+
public int Next;
1616
internal TKey Key; // Key of entry
1717
internal TValue Value; // Value of entry
1818
}
19-
#else
20-
#if (NET5_0)
21-
19+
#elif NETCOREAPP3_0_OR_GREATER
20+
2221
internal struct Entry<TKey, TValue>
2322
{
24-
public uint HashCode;
2523
public int Next;
24+
public uint HashCode;
2625
internal TKey Key; // Key of entry
2726
internal TValue Value; // Value of entry
2827
}
29-
#else
28+
#else
3029
internal struct Entry<TKey, TValue>
3130
{
3231
public int HashCode;
3332
public int Next;
3433
internal TKey Key; // Key of entry
3534
internal TValue Value; // Value of entry
3635
}
37-
#endif
3836
#endif
3937
}
4038
#endif

src/StructLinq/List/ListLayout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace StructLinq.List
77
{
8-
#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0)
8+
#if (NETCOREAPP3_0_OR_GREATER)
99

1010
internal class ListLayout<T>
1111
{

0 commit comments

Comments
 (0)