Unverified Commit 2b485ce5 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] remove unused code in lgb.params2str() (#4337)

parent 1b5bec00
...@@ -24,7 +24,8 @@ lgb.last_error <- function() { ...@@ -24,7 +24,8 @@ lgb.last_error <- function() {
stop("api error: ", err_msg) stop("api error: ", err_msg)
return(invisible(NULL)) return(invisible(NULL))
} }
lgb.params2str <- function(params, ...) {
lgb.params2str <- function(params) {
# Check for a list as input # Check for a list as input
if (!identical(class(params), "list")) { if (!identical(class(params), "list")) {
...@@ -34,24 +35,6 @@ lgb.params2str <- function(params, ...) { ...@@ -34,24 +35,6 @@ lgb.params2str <- function(params, ...) {
# Split parameter names # Split parameter names
names(params) <- gsub("\\.", "_", names(params)) names(params) <- gsub("\\.", "_", names(params))
# Merge parameters from the params and the dots-expansion
dot_params <- list(...)
names(dot_params) <- gsub("\\.", "_", names(dot_params))
# Check for identical parameters
if (length(intersect(names(params), names(dot_params))) > 0L) {
stop(
"Same parameters in "
, sQuote("params")
, " and in the call are not allowed. Please check your "
, sQuote("params")
, " list"
)
}
# Merge parameters
params <- c(params, dot_params)
# Setup temporary variable # Setup temporary variable
ret <- list() ret <- list()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment