From: David Eberlein Date: Thu, 18 Apr 2013 07:51:33 +0000 (+0200) Subject: REFACTORING: Changed if / else cases to optimize the performance for the X-Git-Tag: v1.0.0~37^2~1 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=69df11878c6172fde0e63ed08d64cc96b4b03bae;p=dygraphs.git REFACTORING: Changed if / else cases to optimize the performance for the default cases. --- 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;