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

refactor: Remove some unnecessary uses of sorted sets #8700

Merged
merged 1 commit into from
May 27, 2024

Conversation

fviernau
Copy link
Member

See individual commits.

@fviernau fviernau requested a review from a team as a code owner May 27, 2024 07:38
scopeMappings.keys.toSortedSet().forEach { scope ->
orderedMappings[scope] = scopeMappings.getValue(scope)
scopeMappings.entries.sortedBy { it.key }.forEach { (scope, rootDependencyIndices) ->
orderedMappings[scope] = rootDependencyIndices
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I believe we need a different rationale here, as the code does not really look simpler to me, but longer and more complex. What's the real goal here, I guess to remove the use of toSortedSet()? Then we should say so.

Copy link
Member Author

Choose a reason for hiding this comment

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

My goal was indeed to simplify. I've just dropped this commit.

Copy link
Member

Choose a reason for hiding this comment

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

While reviewing the code base as part of #8705 I've come across this place again, and I've changed my mind a bit:

While the new code still is not really simpler IMO, it's better as it avoids an unneeded getValue() on scopeMappings (and the mention of toSortedSet() which we prefer to get rid of).

So, mind re-introducing the commit with a slightly adjust commit message?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, here you go: #8706.

Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.85%. Comparing base (db8c595) to head (7cd4296).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8700   +/-   ##
=========================================
  Coverage     67.85%   67.85%           
  Complexity     1165     1165           
=========================================
  Files           244      244           
  Lines          7736     7736           
  Branches        865      865           
=========================================
  Hits           5249     5249           
  Misses         2128     2128           
  Partials        359      359           
Flag Coverage Δ
funTest-docker 66.84% <ø> (ø)
funTest-non-docker 34.17% <0.00%> (ø)
test 38.01% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
@sschuberth sschuberth merged commit 41b450b into main May 27, 2024
18 of 20 checks passed
@sschuberth sschuberth deleted the unneeded-sorted-things branch May 27, 2024 09:09
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