-
-
Notifications
You must be signed in to change notification settings - Fork 206
chore: implicit assignments #2664
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,13 +224,18 @@ igraph_i_options <- function(..., .in = parent.frame()) { | |
| temp <- list(...) | ||
| if (length(temp) == 1 && is.null(names(temp))) { | ||
| arg <- temp[[1]] | ||
| switch( | ||
| mode(arg), | ||
| list = temp <- arg, | ||
| character = return(.igraph.pars[arg]), | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can add an exception comment instead but I have to say I had trouble understanding the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO switch only makes sense if it is more than 2 option OR if we expect that the list of options might grow in the future. Independently, I also find this statement confusing |
||
| if (mode(arg) == "character") { | ||
| return(.igraph.pars[arg]) | ||
| } | ||
|
|
||
| if (mode(arg) != "list") { | ||
| cli::cli_abort("invalid argument: {arg}.") | ||
| ) | ||
| } | ||
|
|
||
| temp <- arg | ||
| } | ||
|
|
||
| if (length(temp) == 0) { | ||
| return(get_all_options()) | ||
| } | ||
|
|
||
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.
!!!!!
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.
@krlmlr @schochastics small hackathon topic?