https://bugs.documentfoundation.org/show_bug.cgi?id=141989
--- Comment #4 from Mike Kaganski <[email protected]> ---
(In reply to Colin from comment #3)
> Is there a reason why it works as expected for 10 of the twelve events?
> Shouldn't it just fail miserably and everything return N/A?
It should not "fail miserably". It doesn't check if the data id sorted (doing
which would require checking all elements, which would defeat the idea of fast
search used in this mode); it just assumes the sorting, and uses binary search
(checking value in the middle; then if wanted value is "less than", it searches
first half, otherwise second half - splitting the range to two halves at each
iteration, and only doing small number of comparisons). At each check it will
naturally find that wanted value is smaller or greater than next checked value,
and finally would arrive to some position - and it may accidentally happen to
be correct, but that would be just a coincidence (as in first successful
results). It would arrive to N/A only if at *each* attempt the wanted value
happened to be smaller than checked position (so lookup arrives to position
"before start").
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs