[Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

Maciej Rumianowski maciej.rumianowski at gmail.com
Sat Aug 6 10:59:40 PDT 2011


Hi Eike,

Thanks for review!

Dnia 2011-08-06, sob o godzinie 17:35 +0200, Eike Rathke pisze:
> 
> >              {
> > -                if ( aDelList[i] == nAddKey )
> > +                if ( *it == nAddKey )
> >                  {
> >                      bFound   = sal_True;
> > -                    nAt              = i;
> > +                    nAt              = it;
> >                  }
> >              }
> >              DBG_ASSERT( bFound, "Key not found" );
> > -            aDelList.Remove( nAt );
> > +            aDelList.erase( nAt );
> 
> Hmm.. I'd say the original code was wrong, when nAddKey was not found
> in
> aDelList it removed the first element anyway. That should be
> 
>                if (bFound)
>                    aDelList.erase( nAt );
> 
> instead. 
There was so many questions that I forgot to ask. Should this code be
more changed? Because code in if(isRemoved_Impl()) is only entered if
there is nAddKey in aDelList. My question is why the key is double
searched? I think assertion will never be met.

Best Regards,
	Maciej



More information about the LibreOffice mailing list