Skip to content

Commit

Permalink
Xcode 7.3 converted this one - but Swift crashes for this range.
Browse files Browse the repository at this point in the history
Dammit Apple. Yeah, the end might be < start in some cases.
Just make these work like normal loops...
  • Loading branch information
danielgindi committed Mar 30, 2016
1 parent 2d97984 commit f1a84d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down

0 comments on commit f1a84d6

Please sign in to comment.