From a7cd48dbeb9fa44ff1714e908fb85cdf34ae7428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?fran=C3=A7ois=20GUILLEM?= Date: Tue, 8 Aug 2017 13:58:47 +0200 Subject: [PATCH] replace isTRUE(all.equal(...)) by identical(...) --- R/controller.R | 4 ++-- R/input_class.R | 4 ++-- R/input_list_class.R | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/R/controller.R b/R/controller.R index 6b124c8..5ab3d2f 100644 --- a/R/controller.R +++ b/R/controller.R @@ -116,7 +116,7 @@ MWController <- setRefClass( oldValue <- getValue(name, chartId) newValue <- inputList$setValue(name, value, chartId) if (!initialized) return() - if (autoUpdate && !isTRUE(all.equal(oldValue, newValue))) { + if (autoUpdate && !identical(oldValue, newValue)) { if (inputList$isShared(name)) updateCharts() else updateChart(chartId) } @@ -126,7 +126,7 @@ MWController <- setRefClass( oldValue <- getValueById(id) newValue <- inputList$setValue(inputId = id, value = value) if (!initialized) return() - if (autoUpdate && !isTRUE(all.equal(oldValue, newValue))) { + if (autoUpdate && !identical(oldValue, newValue)) { if (grepl("^shared_", id)) updateCharts() else { chartId <- get(".id", envir = inputList$inputs[[id]]$env) diff --git a/R/input_class.R b/R/input_class.R index e1e489a..4d318d9 100644 --- a/R/input_class.R +++ b/R/input_class.R @@ -49,7 +49,7 @@ Input <- setRefClass( catIfDebug("Update value of ", getID()) oldValue <- value if (!emptyField(validFunc)) value <<- validFunc(value, getParams()) - if (!isTRUE(all.equal(value, oldValue))) { + if (!identical(value, oldValue)) { valueHasChanged <<- TRUE assign(name, value, envir = env) } @@ -63,7 +63,7 @@ Input <- setRefClass( for (n in names(lastParams)) { if (!is.null(oldParams[[n]]) && - !isTRUE(all.equal(lastParams[[n]], oldParams[[n]]))) { + !identical(lastParams[[n]], oldParams[[n]])) { changedParams[[n]] <<- lastParams[[n]] } } diff --git a/R/input_list_class.R b/R/input_list_class.R index 487866b..cd60bfa 100644 --- a/R/input_list_class.R +++ b/R/input_list_class.R @@ -126,8 +126,7 @@ InputList <- setRefClass( while(TRUE) { n <- n + 1 valueHasChanged <- sapply(inputs, function(x) { - #if (x$type == "group") return(FALSE) - !isTRUE(all.equal(x$value, x$updateValue())) + !identical(x$value, x$updateValue()) }) if (all(!valueHasChanged) | n > 10) break }