Skip to content

Simplifications and cleaning up unused imports #84

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

Merged
merged 17 commits into from
Jun 22, 2021

Conversation

YektaDev
Copy link
Contributor

No description provided.

@adhesivee
Copy link
Collaborator

Can one of the admins verify this patch?

@YektaDev
Copy link
Contributor Author

I haven't made any logical changes; except for one function whose return type was unnecessarily nullable and now is non-nullable. Every other change is just optimization, simplification, or fixing indent.

@YektaDev
Copy link
Contributor Author

Are there any issues?

val authorizedGrantType = AuthorizedGrantType.AUTHORIZATION_CODE
if (!clientOf.authorizedGrantTypes.contains(authorizedGrantType)) {
throw InvalidGrantException("Authorize not allowed: '$authorizedGrantType'")
with(AuthorizedGrantType.AUTHORIZATION_CODE) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In this case, I don't see what with provides more then previous solution?
It requires extra level of nesting, and instead of assigning it to a named variable, it is now assigned to this

Copy link
Contributor Author

@YektaDev YektaDev Jun 22, 2021

Choose a reason for hiding this comment

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

I thought this extra level of nesting would be clearer than introducing a new variable that will be used only once. The nested block isn't big enough though. So, I guess it's between the gap of noisy and clean code, or it's just a matter of preference.

@adhesivee
Copy link
Collaborator

@YektaDev Needed to find some time to do the review.
One remark, not a big point. Would be nice if you can explain it.

@adhesivee adhesivee merged commit b3ff7f2 into myndocs:develop Jun 22, 2021
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