From 4d3cf421c1c51126b5c7cd94bfd6e4eec151adee Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Thu, 25 Mar 2021 15:49:10 +0100
Subject: [PATCH] refactor: replace the use of as.integer(0) by 0L in
 CreateRunOptions

---
 R/CreateRunOptions.R | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/R/CreateRunOptions.R b/R/CreateRunOptions.R
index d7acd329..58af4d5d 100644
--- a/R/CreateRunOptions.R
+++ b/R/CreateRunOptions.R
@@ -117,7 +117,7 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
     WTxt <- paste(WTxt, "model warm up period not defined: default configuration used", sep = "")
     ##If_the_run_period_starts_at_the_very_beginning_of_the_time_series
     if (IndPeriod_Run[1L] == 1L) {
-      IndPeriod_WarmUp <- as.integer(0)
+      IndPeriod_WarmUp <- 0L
       WTxt <- paste0(WTxt,"\n no data were found for model warm up!")
       ##We_look_for_the_longest_period_preceeding_the_run_period_with_a_maximum_of_one_year
     } else {
@@ -159,10 +159,10 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
     if (storage.mode(IndPeriod_WarmUp) != "integer") {
       stop("'IndPeriod_WarmUp' should be of type integer")
     }
-    if (identical(IndPeriod_WarmUp, as.integer(0)) & verbose) {
+    if (identical(IndPeriod_WarmUp, 0L) & verbose) {
       message(paste0(WTxt, " No warm up period is used"))
     }
-    if ((IndPeriod_Run[1] - 1) != tail(IndPeriod_WarmUp, 1) & !identical(IndPeriod_WarmUp, as.integer(0))) {
+    if ((IndPeriod_Run[1] - 1) != tail(IndPeriod_WarmUp, 1) & !identical(IndPeriod_WarmUp, 0L)) {
       WTxt <- paste0(WTxt, " Model warm up period is not directly before the model run period")
     }
   }
-- 
GitLab