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

Remove unnecessary null #411

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open

Remove unnecessary null #411

wants to merge 1 commit into from

Conversation

hfhbd
Copy link
Contributor

@hfhbd hfhbd commented Mar 12, 2025

No description provided.

@JakeWharton
Copy link
Collaborator

This was intentional for reading purposes so the two cases visually align. Maybe we can find some alternate structure to make the code both visually pleasant and without wasted branching?

@hfhbd
Copy link
Contributor Author

hfhbd commented Mar 12, 2025

without wasted branching?

You mean without good old variables?

Comment on lines +112 to 114
val ignoredData = config.ignoredGroupIds[id.group]?.also { unusedGroupIds -= id.group }
?: config.ignoredCoordinates[id.group]?.get(id.module)
?.also { unusedCoordinates -= id.group to id.module }
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about this?

Suggested change
val ignoredData = config.ignoredGroupIds[id.group]?.also { unusedGroupIds -= id.group }
?: config.ignoredCoordinates[id.group]?.get(id.module)
?.also { unusedCoordinates -= id.group to id.module }
val ignoredByGroupId = config.ignoredGroupIds[id.group]
val ignoredByCoordinate = config.ignoredCoordinates[id.group]?.get(id.module)
val ignoredData = ignoredByGroupId?.also { unusedGroupIds -= id.group }
?: ignoredByCoordinate?.also { unusedCoordinates -= id.group to id.module }

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