From 69df11878c6172fde0e63ed08d64cc96b4b03bae Mon Sep 17 00:00:00 2001 From: David Eberlein Date: Thu, 18 Apr 2013 09:51:33 +0200 Subject: [PATCH] REFACTORING: Changed if / else cases to optimize the performance for the default cases. --- dygraph.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dygraph.js b/dygraph.js index bfdfc4d..c09f9dd 100644 --- a/dygraph.js +++ b/dygraph.js @@ -2771,12 +2771,10 @@ Dygraph.prototype.extractSeries_ = function(rawData, i, logScale) { } } // Fix null points to fit the display type standard. - if(point === null && errorBars) { - series.push([x, [null,null]]); - } else if(point === null && customBars) { - series.push([x, [null,null,null]]); - } else { + if(point !== null) { series.push([x, point]); + } else { + series.push([x, errorBars ? [null, null] : customBars ? [null, null, null] : point]); } } return series; -- 2.7.4