Hello Matthias,

I'm afraid it is not fixed. I had spent hours to verify the validity
of my submission. It really really is the wrong search function. With
this search function, you just don't find some files. The list has
been sorted with a different search function.

Also, the binary search algorithm does not search in any "direction".
It uses two indices, one starting at 0 and the other starting at
FListing.NameCount-1. So the whole list is searched, and if you use
the correct search function, then you will find it without looking
in another direction.

Cheers,
Tobias


Matthias wrote:
> The problem was probably something that the algorithm only searched in
> one direction, not the wrong search function. Can you test, if it is
> fixed?

as a reply to my original submission:

> > I would like to submit the attached patch. I noticed that some of my
> > source files could not be found by the IDE. The reason is that in 
> > TCTDirectoryCache.FindUnitSource, the binary search uses a different
> > comparison function from the one that FListing was originally sorted
> > with.
> > 
> > Sorting a list with one comparison function, then doing a binary
> > search with a different one, can cause the binary search to fail.
> > 
> > On Mac OS X, the binary search failed when filenames with underscores
> > were used. Some comparison functions sort the underscore _ before the
> > letters, while other comparison functions sort the underscore after
> > the letters.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to