Skip to content

Commit 8930c11

Browse files
committed
refactor: make_empty_graph() is now fully auto-generated
1 parent ebac5c8 commit 8930c11

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

R/make.R

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -698,25 +698,7 @@ undirected_graph <- function(...) constructor_spec(make_undirected_graph, ...)
698698
#' @examples
699699
#' make_empty_graph(n = 10)
700700
#' make_empty_graph(n = 5, directed = FALSE)
701-
make_empty_graph <- function(n = 0, directed = TRUE) {
702-
# Argument checks
703-
if (is.null(n)) {
704-
stop("number of vertices must be an integer")
705-
}
706-
707-
n <- suppressWarnings(as.numeric(n))
708-
if (is.na(n)) {
709-
stop("number of vertices must be an integer")
710-
}
711-
712-
directed <- as.logical(directed)
713-
714-
on.exit(.Call(R_igraph_finalizer))
715-
# Function call
716-
res <- .Call(R_igraph_empty, n, directed)
717-
718-
res
719-
}
701+
make_empty_graph <- empty_impl
720702

721703
#' @rdname make_empty_graph
722704
#' @param ... Passed to `make_graph_empty`.

0 commit comments

Comments
 (0)