-
Notifications
You must be signed in to change notification settings - Fork 138
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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))
}
There was a problem hiding this comment.
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))) | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Thank you! |
#1712