Skip to content

Commit

Permalink
replace isTRUE(all.equal(...)) by identical(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisGuillem committed Aug 8, 2017
1 parent 85606f7 commit a7cd48d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions R/controller.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/input_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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]]
}
}
Expand Down
3 changes: 1 addition & 2 deletions R/input_list_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a7cd48d

Please sign in to comment.