[Kde-games-devel] kspaceduel: replace Q3PtrList with QtList

Dirk dirkrathlev at gmx.de
Thu Jan 4 22:46:41 CET 2007


> In 
>
> +      for (k=0; k<mines[i]->size(); k++)
> +      {
> +         ms = mines[i]->value(k);
> +         (*(aiMines[i]))[j]=ms->toAiSprite();
> +         j++;
> +      }
> +      // FIXME: use Qlist::count()?
>
> k and j are the same, so you can just kill one of them.
>
> Also don't understand the // FIXME: use Qlist::count()?
>   
FIXME was a reminder for me I forgot to remove. j is used to count the 
items and I was wondering whether this needs to be done manually. k is 
indeed unnecessary, thanks for pointing this out.
> Also you have a copy&paste problem on
>
> -      h=minesHitByShot.first();
> -      while(h)
> +//       h=minesHitByShot.first();
> +      i=0;
> +      while(i<objectsHitByShip.size())
>        {
> +         h=objectsHitByShip[i];
>
> both the while and h= should be minesHitByShot not objectsHitByShip
>   
You're right, thank you. This bug would have be very difficult to find 
in the future.


Best regards,
Dirk



More information about the kde-games-devel mailing list