Subject: Re: [htdig3-dev] List::Get_Next index bug
From: Geoff Hutchison (ghutchis@wso.williams.edu)
Date: Tue Jan 04 2000 - 14:22:35 PST
At 7:44 PM +0200 12/28/99, Vadim Chekan wrote:
>Hi!
>
>In process of recovering "prefix" search method I foung 2 bugs:
>Strings::lowercase(),Strings::uppercase() didn't support national chars:
>fix commited, and List::Get_Next() don't change current_index.
>
>List::Start_Get:
>void Start_Get(ListCursor& cursor) const { cursor.current
>= head; cursor.current_index = -1;}
>
> >From List::Get_Next()
> if (cursor.current_index >= 0)
> cursor.current_index++;
>
> ^^^^^ this code never executes because current_index == -1
>
>My preposition:
> 1. start current_index counting from 0, not from -1.
> 2. remove check cursor.current_index >= 0. Anyone know what for it is?
I think I can answer #2: It ensures Get_Next() doesn't work unless
you've performed a Start_Get().
I can't think of a good reason not to do #1, but we could just as well add:
else (cursor.current_index == -1)
cursor.current_index = 0;
-Geoff
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
htdig3-dev-unsubscribe@htdig.org
You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Tue Jan 04 2000 - 15:17:09 PST