Fix the previous fix: skip algo if the guessed index was out of bounds.

Authored by dfaure on Jul 17 2017, 1:47 PM.

Description

Fix the previous fix: skip algo if the guessed index was out of bounds.

Setting to the last item would miss checking the last item itself,
so the method would return -1 by mistake if the last item was the one we
were looking for.

Arguably it would be faster to do a reverse search in that case though.

Note that removing the -1 in qMin wouldn't work either, bwdIt==end skips
all backward search.

CCMAIL: dvratil@kde.org

Details

Committed
dfaureJul 17 2017, 1:51 PM
Parents
R94:6948f86e8e1a: Fix another crash in this code, where fwdIt would keep going, past the end
Branches
Unknown
Tags
Unknown
References
tag: v17.07.80