Skip to content

Commit 7e35bb3

Browse files
Merge branch 'main' into jonathanpeppers/branchless-scalar-minmax
2 parents 57acd68 + 4ec820d commit 7e35bb3

7 files changed

Lines changed: 207 additions & 195 deletions

File tree

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*.cs]
4+
# Enforce analyzers on source-generated code
5+
generated_code = analyzed
6+
# IDE0300: Use collection expression for array
7+
dotnet_diagnostic.IDE0300.severity = error
8+
# IDE0301: Use collection expression for empty
9+
dotnet_diagnostic.IDE0301.severity = error
10+
# IDE0302: Use collection expression for stackalloc
11+
dotnet_diagnostic.IDE0302.severity = error

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<LangVersion>latest</LangVersion>
7+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
78
<Version>0.1.1</Version>
89
<Copyright>Copyright (c) Jonathan Peppers</Copyright>
910
</PropertyGroup>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ using SortingNetworks;
3333
partial class MySorter { }
3434

3535
// Sort a span of exactly 27 ints
36-
Span<int> data = stackalloc int[] {
36+
Span<int> data = [
3737
27, 26, 25, 24, 23, 22, 21, 20, 19,
3838
18, 17, 16, 15, 14, 13, 12, 11, 10,
3939
9, 8, 7, 6, 5, 4, 3, 2, 1,
40-
};
40+
];
4141
MySorter.Sort(data);
4242

4343
// Array overload
44-
int[] array = { 3, 1, 4, 1, 5, 9, 2, 6, /* ... 27 elements */ };
44+
int[] array = [3, 1, 4, 1, 5, 9, 2, 6, /* ... 27 elements */];
4545
MySorter.Sort(array);
4646

4747
// IComparer<T> overload

0 commit comments

Comments
 (0)