incorrect getDataSetIndexByLabel function
Open
bug
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
internal func getDataSetIndexByLabel(_ label: String, ignorecase: Bool) -> Int
{
// TODO: Return nil instead of -1
if ignorecase
{
return dataSets.firstIndex {
guard let label = $0.label else { return false }
return label.caseInsensitiveCompare(label) == .orderedSame
} ?? -1
}
else
{
return dataSets.firstIndex { $0.label == label }
?? -1
}
}
label.caseInsensitiveCompare(label) == .orderedSame is always return true,The let label name is the same as the parameter name
Contributor guide
Assessment
This issue has not been assessed yet.