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

dictionaryish(NULL) return true #1741

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

ilovemane
Copy link
Contributor

@ilovemane ilovemane changed the title update dictionaryish(NULL) return true Aug 15, 2024
Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

Looking good! Just a couple of nitpicks.

Also can you please add a NEWS bullet referencing the issue number and tagging your username?

R/attr.R Outdated
return(!is.null(x))
}
if (is.null(x)) {
TRUE
Copy link
Member

Choose a reason for hiding this comment

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

I'd do this with an early return so that the rest of the function is not nested in a branch. So something like:

if (is.null(x)) {
  return(TRUE)
}
if (!length(x)) {
  return(!is.null(x))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!


is_named(x) && !any(duplicated(names(x)))
is_named(x) && !any(duplicated(names(x)))

Copy link
Member

Choose a reason for hiding this comment

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

Can you remove this new unnecessary whitespace please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@lionel- lionel- merged commit d2829e2 into r-lib:main Aug 15, 2024
11 checks passed
@lionel-
Copy link
Member

lionel- commented Aug 15, 2024

Thank you!

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