diff --git a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift index 703c0abe72..5fdb3068c5 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift @@ -196,10 +196,7 @@ open class ChartDataSet: ChartBaseDataSet /// An empty array if no Entry object at that index. open override func entriesForXValue(_ xValue: Double) -> [ChartDataEntry] { - 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.filter { $0.x == xValue } } /// - Parameters: