Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*.cs]
# Enforce analyzers on source-generated code
generated_code = analyzed
Comment thread
jonathanpeppers marked this conversation as resolved.
# IDE0300: Use collection expression for array
dotnet_diagnostic.IDE0300.severity = error
# IDE0301: Use collection expression for empty
dotnet_diagnostic.IDE0301.severity = error
# IDE0302: Use collection expression for stackalloc
dotnet_diagnostic.IDE0302.severity = error
Comment thread
jonathanpeppers marked this conversation as resolved.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<Version>0.1.1</Version>
<Copyright>Copyright (c) Jonathan Peppers</Copyright>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ using SortingNetworks;
partial class MySorter { }

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

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

// IComparer<T> overload
Expand Down
Loading