From 1006847b7a2ac583606602f6cc0d2d2f38b4f634 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 29 Oct 2020 12:04:41 +0100 Subject: [PATCH] Performance Fix --- Commons.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Commons.js b/Commons.js index 050791f24..eaa28c2e1 100644 --- a/Commons.js +++ b/Commons.js @@ -380,12 +380,6 @@ let product = {} product[variableName] = {} - /* Here is how we know if we are processing Yesterday. */ - let positionedAtYesterday = false - if (processingDailyFiles) { - positionedAtYesterday = (record.current.end < currentDay.valueOf()) - } - /* This is Loop Code */ try { eval(dataBuildingProcedure.loop.javascriptCode.code) @@ -423,9 +417,9 @@ results.push(product[variableName]); } - /* While we are positioned at Yesterday, we keep updating this data structure. */ + /* At the last instant of yesterday, we update the yesterday object. */ if (processingDailyFiles) { - if (positionedAtYesterday) { + if (record.current.end + 1 === currentDay.valueOf()) { yesterday.variable = JSON.parse(JSON.stringify(variable)) } }