Can you explain more about what should i do, this is first time i read crash log. I did test binarySearch(in:for:) with many types of input, i have never got crash. Sorry because my English is not good so some point is not clear.
Are you sure your id are such that < comparison works in this case ("300" is not less than "1000" because of string comparison).
Oh, honestly i'm not sure about whether "300" is less than "1000" or not when comparing in swift, i will find out and optimize this point, thank you so much.
But in my opinion, I think "300" is not less than "1000" or not is not the point cause crash, because:
Even "300" is less than "1000" or not, it will return wrong value instead of crash(this point might be logic issue).
On my perspective what ever value of ** blIdContact ** is, as long as it's unique and not null, it shouldn't be crash. And I did test on many data set that i create by my self (with many type and form of inputs)s
Yes i'm very sure it's all in String form, that list fetch from DB query and all element was check one by one.
But thread 25 have something i cannot understand, this issue doesn't happen when data set is small (less than 1000 - when testing) but happen in the released app. I take this log from Xcode crashes report but i never get this when testing on my own device.
This is binary search algorithm - you could reach it there: https://www.geeksforgeeks.org/binary-search/.
Using binary search when you want to find an element in an enormous ordered list.
Can you explain more about what should i do, this is first time i read crash log. I did test binarySearch(in:for:) with many types of input, i have never got crash. Sorry because my English is not good so some point is not clear.
Are you sure your id are such that < comparison works in this case ("300" is not less than "1000" because of string comparison).
Oh, honestly i'm not sure about whether "300" is less than "1000" or not when comparing in swift, i will find out and optimize this point, thank you so much.
But in my opinion, I think "300" is not less than "1000" or not is not the point cause crash, because:
Even "300" is less than "1000" or not, it will return wrong value instead of crash(this point might be logic issue).
On my perspective what ever value of ** blIdContact ** is, as long as it's unique and not null, it shouldn't be crash. And I did test on many data set that i create by my self (with many type and form of inputs)s
Yes i'm very sure it's all in String form, that list fetch from DB query and all element was check one by one.
But thread 25 have something i cannot understand, this issue doesn't happen when data set is small (less than 1000 - when testing) but happen in the released app. I take this log from Xcode crashes report but i never get this when testing on my own device.
This is binary search algorithm - you could reach it there: https://www.geeksforgeeks.org/binary-search/.
Using binary search when you want to find an element in an enormous ordered list.