mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 07:31:20 +02:00
* handle collections with 0 or 1 element better
git-svn-id: trunk@4459 -
This commit is contained in:
parent
0d8b05c73e
commit
9766a9c14a
@ -2221,6 +2221,9 @@ BEGIN
|
||||
Search := False; { Preset failure }
|
||||
L := 0; { Start count }
|
||||
H := Count - 1; { End count }
|
||||
Index := 0;
|
||||
if H<=0 then
|
||||
exit;
|
||||
While (L <= H) Do Begin
|
||||
I := (L + H) SHR 1; { Mid point }
|
||||
C := Compare(KeyOf(Items^[I]), Key); { Compare with key }
|
||||
|
Loading…
Reference in New Issue
Block a user