This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] Fix iterator bug in choose.cc
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Robert Collins <rbcollins at cygwin dot com>
- Cc: cygwin-apps at cygwin dot com
- Date: Thu, 13 Mar 2003 16:07:13 -0500 (EST)
- Subject: Re: [PATCH] Fix iterator bug in choose.cc
- Reply-to: cygwin-apps at cygwin dot com
On 14 Mar 2003, Robert Collins wrote:
> On Fri, 2003-03-14 at 07:47, Igor Pechtchanski wrote:
> > I noticed there is a bug in an iterator in choose.cc that causes "All" to
> > be printed twice in the list of categories in setup.log.full. The
> > attached patch fixes that. Note that, like the original, the patch will
> > not work if a package is not in any category (but that shouldn't happen
> > anyway, right?).
> > Igor
> > ==============================================================================
> > 2003-03-13 Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
> >
> > * choose.cc (ChooserPage::OnNext): Fix iterator bug.
>
> Nice catch. Wouldn't
> = pkg.categories.begin ();
> -> String all_categories = *(i++);
>
> Be an easier fix?
It's shorter, but I dislike the use of increment operators outside of
loops. Leads to obscure errors. Personal preference, y'know... :-)
But it's your preference that counts, so feel free to tweak it.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha at cs dot nyu dot edu
ZZZzz /,`.-'`' -. ;-;;,_ igor at watson dot ibm dot com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
-- /usr/games/fortune