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

ScanBy: Update docs #882

Closed
wants to merge 5 commits into from
Closed

ScanBy: Update docs #882

wants to merge 5 commits into from

Conversation

viceroypenguin
Copy link
Contributor

This PR adds to #803. It updates documentation. ScanBy does not need other changes to address nullability documentation.

@codecov
Copy link

codecov bot commented Nov 14, 2022

Codecov Report

Merging #882 (48f3387) into master (ba487dd) will decrease coverage by 0.14%.
The diff coverage is 71.79%.

❗ Current head 48f3387 differs from pull request most recent head 8520a34. Consider uploading reports for the commit 8520a34 to get more accurate results

@@            Coverage Diff             @@
##           master     #882      +/-   ##
==========================================
- Coverage   92.53%   92.38%   -0.15%     
==========================================
  Files         108      110       +2     
  Lines        3428     3441      +13     
  Branches     1020     1020              
==========================================
+ Hits         3172     3179       +7     
- Misses        194      200       +6     
  Partials       62       62              
Impacted Files Coverage Δ
MoreLinq/FallbackIfEmpty.cs 88.67% <ø> (ø)
MoreLinq/Pad.cs 100.00% <ø> (ø)
MoreLinq/Partition.cs 98.24% <ø> (ø)
MoreLinq/Reactive/Subject.cs 81.53% <0.00%> (ø)
MoreLinq/Lookup.cs 61.87% <33.33%> (-2.26%) ⬇️
MoreLinq/Assume.cs 100.00% <100.00%> (ø)
MoreLinq/Debug.cs 100.00% <100.00%> (ø)
MoreLinq/Fold.cs 98.07% <100.00%> (ø)
MoreLinq/PartialSort.cs 100.00% <100.00%> (ø)
MoreLinq/ScanBy.cs 95.23% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

MoreLinq/ScanBy.cs Outdated Show resolved Hide resolved
MoreLinq/ScanBy.cs Outdated Show resolved Hide resolved
Copy link
Member

@atifaziz atifaziz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this PR makes two unrelated changes. Can we please have each in their own PR?

Also, if ScanBy doesn't need changes with respect to #803 then let's enable nullable context on its unit tests, which is a good way to exercise its signature.

reduce captures size

I think it reduces an allocation, but not the capture size? Either way, it would be best done as a sweeping change in one PR?

@viceroypenguin
Copy link
Contributor Author

I think it reduces an allocation, but not the capture size? Either way, it would be best done as a sweeping change in one PR?

Sure.

KeyValuePair.Create("bar" , 1),
KeyValuePair.Create((string)null, 3),
KeyValuePair.Create("foo" , 1));
KeyValuePair.Create<string?, int>("foo", 0),
Copy link
Contributor Author

@viceroypenguin viceroypenguin Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type explicit to improve nullability behavior since KeyValuePair.Create() enforces a nullability value without target-typing to the sequence nullability type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could go with typing just the one needed:

            result.AssertSequenceEqual(
                KeyValuePair.Create((string?)"foo", 0),
                KeyValuePair.Create((string?)null , 0),
                KeyValuePair.Create((string?)"bar", 0),
                KeyValuePair.Create((string?)"baz", 0),
                KeyValuePair.Create((string?)null , 1),
                KeyValuePair.Create((string?)null , 2),
                KeyValuePair.Create((string?)"baz", 1),
                KeyValuePair.Create((string?)"bar", 1),
                KeyValuePair.Create((string?)null , 3),
                KeyValuePair.Create((string?)"foo", 1));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but I honestly like the other one better. Generally, to me, an explicit type cast like this feels like I may have done something wrong to need the cast, whereas target-typing using the explicit type of .Create() feels more natural. Just my opinion though.

@viceroypenguin viceroypenguin changed the title ScanBy: Update docs and reduce captures size ScanBy: Update docs Nov 14, 2022
@atifaziz
Copy link
Member

@viceroypenguin Any follow-up?

@viceroypenguin
Copy link
Contributor Author

I'm not sure what your concern is. Per

Unfortunately, this PR makes two unrelated changes. Can we please have each in their own PR?

the "reduces capture size" change was reverted. This PR was also updated per your request to include

Also, if ScanBy doesn't need changes with respect to #803 then let's enable nullable context on its unit tests, which is a good way to exercise its signature.

There is an unanswered expressed opinion here, but otherwise the only thing necessary for this PR is to resolve conflicts with latest.

@atifaziz
Copy link
Member

I'm not sure what your concern is.

No concern. Just this:

Unfortunately, this PR makes two unrelated changes. Can we please have each in their own PR?

Title of this PR reads says it updates the documentation (unrelated to #803), but it does more.

@viceroypenguin
Copy link
Contributor Author

If you resolve conflicts with mainline, the additional changes will work themselves out. I'll let you take care of that at your leisure.

@atifaziz
Copy link
Member

If you resolve conflicts with mainline, the additional changes will work themselves out. I'll let you take care of that at your leisure.

This is your contribution. If you don't wish to or lost the motivation to see it through, including resolving conflicts and undoing unrelated changes, then that's fine. I'll go ahead and close it for now but happy to re-open if you'd like to help.

@atifaziz atifaziz closed this Jun 26, 2023
@viceroypenguin viceroypenguin deleted the scanby branch June 26, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants