From f1a84d6e9f969117289fbf778e9c6c88d4ae9bc7 Mon Sep 17 00:00:00 2001 From: Daniel Cohen Gindi Date: Wed, 30 Mar 2016 22:06:22 +0300 Subject: [PATCH] Xcode 7.3 converted this one - but Swift crashes for this range. Dammit Apple. Yeah, the end might be < start in some cases. Just make these work like normal loops... --- Charts/Classes/Renderers/LineChartRenderer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Charts/Classes/Renderers/LineChartRenderer.swift b/Charts/Classes/Renderers/LineChartRenderer.swift index 7b160b1fe0..1670e6253e 100644 --- a/Charts/Classes/Renderers/LineChartRenderer.swift +++ b/Charts/Classes/Renderers/LineChartRenderer.swift @@ -440,7 +440,7 @@ public class LineChartRenderer: LineRadarChartRenderer } // create a new path - for x in from + 1 ..< Int(ceil(CGFloat(to - from) * phaseX + CGFloat(from))) + for x in from + 1 ..< max(from + 1, Int(ceil(CGFloat(to - from) * phaseX + CGFloat(from)))) { guard let e = dataSet.entryForIndex(x) else { continue }