Skip to content

Commit

Permalink
Use lazy implementation of prefix(while:)
Browse files Browse the repository at this point in the history
For better performance
  • Loading branch information
jjatie committed Jan 28, 2021
1 parent f95f959 commit 69a303f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ open class ChartDataSet: ChartBaseDataSet
let match: (ChartDataEntry) -> Bool = { $0.x == xValue }
let i = partitioningIndex(where: match)
guard i < endIndex else { return [] }
return self[i...].prefix(while: match)
return self[i...].lazy.prefix(while: match)
}

/// - Parameters:
Expand Down

0 comments on commit 69a303f

Please sign in to comment.