F124 - Failure Feedback Forum
Currently, Search() returns 0 if the view is of size 0. This behavior is odd because you can't therefore use Search() to check if an entry exists and add it if it doesn't on a 0-row view. You will get 0, the check for -1 will return false, and then you call SetAt(0,row) and it crashes.
This is not quite the case, I think - the docs in view.cpp say:
Search for a key, using the native sort order of the view
Return position where found, or where it may be inserted,
this position can also be just past the last row
So returning 0 on an empty view would seem to be consistent with that: it's the position where one inserts new items, if the row at the returned position does not match or is past the end.
Imported