Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump RangeExtensions from 1.2.2 to 2.0.0 #24

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 23, 2022

Bumps RangeExtensions from 1.2.2 to 2.0.0.

Release notes

Sourced from RangeExtensions's releases.

2.0.0

Changes

✨ New Features

Select and Where

This release expands the list of Range extensions with several convenience methods that bring it much closer to counterparts in Rust, Python and others.

var floats = (0..100).Select(i => (float)i);
var odd = (0..100).Where(i => i % 2 != 0);
var randomNumbers = (0..1000)
.Select(_ => Random.Shared.Next())
.ToArray();

Iterating through these directly is significantly faster when compared to Enumerable.Range. In fact, with DynamicPGO enabled, on osx-arm64 the loop foreach (var i in (0..1000).Select(i => i * 2)) gets within 1.3-1.5x ratio of a regular plain for loop. Delegate devirtualization has gotten so good!

IList on RangeEnumerable and SelectRange

Now both these types also implement IList. While RangeEnumerable is effectively a materialized sequence of numbers, SelectRange serves a purpose of "Select View" over that sequence, with exact T values materialized on access similar to plain IEnumerable<T>.

While this does not conform 100% to existing semantics, it was a necessary change to take the advantage of IEnumerable internals for methods that lack bespoke implementations in this library or when RangeExtensions enumerators are boxed.

Bespoke Aggregate, First, Last and more

The library now exposes additional bespoke LINQ method implementations for shorthand usage together with Range that further improve its usability in functional scenarios.

var digits = (0..10)
    .Aggregate(new StringBuilder(), (sb, i) => sb.Append(i))
    .ToString();
Assert.Equal("0123456789", digits);
// None of these allocate, and all of them are O(1)
var fifteenthDecimal = (0..1337)
.Select(i => (decimal)i)
.Take(10)
.ElementAt(4); // or even just [4]
// Efficient scan from the end of the range
var lastEven = (0..1337)
.Where(i => i % 2 is 0)
.Last();

... (truncated)

Commits
  • 234da64 Select and Where specialized impl. (#10)
  • b61b836 Bump Microsoft.NET.Test.Sdk from 17.4.0 to 17.4.1 (#13)
  • 1322760 Bump Microsoft.NET.Test.Sdk from 17.3.2 to 17.4.0 (#12)
  • 0539ba8 Bump coverlet.collector from 3.1.2 to 3.2.0 (#11)
  • f98a509 Add PackageProjetUrl to make github happy
  • 5af1e65 Bump Microsoft.NET.Test.Sdk from 17.3.1 to 17.3.2 (#9)
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [RangeExtensions](https://github.com/neon-sunset/RangeExtensions) from 1.2.2 to 2.0.0.
- [Release notes](https://github.com/neon-sunset/RangeExtensions/releases)
- [Changelog](https://github.com/neon-sunset/RangeExtensions/blob/main/dotnet-releaser.toml)
- [Commits](neon-sunset/RangeExtensions@1.2.2...2.0.0)

---
updated-dependencies:
- dependency-name: RangeExtensions
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Dec 23, 2022
@coveralls
Copy link

Coverage Status

Coverage: 92.913% (+0.2%) from 92.683% when pulling d9ec5ae on dependabot/nuget/RangeExtensions-2.0.0 into af5c74d on main.

@neon-sunset neon-sunset merged commit 1322ece into main Dec 23, 2022
@neon-sunset neon-sunset deleted the dependabot/nuget/RangeExtensions-2.0.0 branch December 23, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants