Skip to content

Commit

Permalink
Update description
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-sunset committed Aug 13, 2022
1 parent 6a6ccb6 commit f453133
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# RangeExtensions
[![CI/CD](https://github.com/neon-sunset/RangeExtensions/actions/workflows/dotnet-releaser.yml/badge.svg)](https://github.com/neon-sunset/RangeExtensions/actions/workflows/dotnet-releaser.yml) [![nuget](https://badgen.net/nuget/v/RangeExtensions/latest)](https://www.nuget.org/packages/RangeExtensions/) [![Coverage Status](https://coveralls.io/repos/github/neon-sunset/RangeExtensions/badge.svg)](https://coveralls.io/github/neon-sunset/RangeExtensions)

Extensions for Range type to support `foreach` and `RangeEnumerable` that implements `IEnumerable<int>`.
- Correctness is verified against standard `IEnumerable<int>` and `Enumerable.Range` behavior
- Performance is hand tuned to produce efficient native code with no allocations as long as `RangeEnumerable` isn't boxed into `IEnumerable<int>` (same applies to enumerator)
This package allows you to use `0..100` in `foreach` expressions and implements `RangeEnumerable` that supports a variety of LINQ-like operations as well as `ICollection<int>` and `IEnumerable<int>`.
- Correctness is verified against standard `IEnumerable<int>` and `Enumerable.Range` behavior;
- Performance is hand tuned to produce efficient native code with no allocations as long as `RangeEnumerable` isn't boxed (same applies to enumerator). However, even when boxed it is still faster than `Enumerable.Range`.

## Features
### Range enumeration
```cs
foreach (var i in 0..100)
foreach (var i in ..100) // you can write 0..Length as just ..Length
{
Console.WriteLine(i);
}
Expand Down
1 change: 1 addition & 0 deletions RangeExtensions/RangeEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public record struct Enumerator : IEnumerator<int>
{
private readonly int _shift;
private readonly int _end;

private int _current;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
4 changes: 2 additions & 2 deletions RangeExtensions/RangeExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Authors>neon-sunset</Authors>
<RepositoryUrl>https://github.com/neon-sunset/RangeExtensions</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>Range;Extensions;LINQ;IEnumerable;foreach;RangeForEach</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Extensions for Range type to support 'foreach' and 'RangeEnumerable' that implements 'IEnumerable'.</Description>
<Description>Extensions for Range that add foreach and ICollection/IEnumerable support.</Description>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit f453133

Please sign in to comment.