[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: [Kde-games-devel] Palapeli -> kdereview
From: Stefan Majewsky <majewsky () gmx ! net>
Date: 2009-11-11 9:13:36
Message-ID: 200911111013.37171.majewsky () gmx ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
Am Dienstag 10 November 2009 19:57:15 schrieb Albert Astals Cid:
> A comment on code, you have one or two places where do you things like
>
> QList<int> pieceIndices = pieces.keys();
> foreach (int index, pieceIndices)
> {
> if (!pieces[index].save(cachePath + QString("%1.png").arg(index)))
> {
> std::cerr << "Could not save piece image no. " << index << std::endl;
> return 1;
> }
> }
>
> That is asking for the keys of a map and then iterating them to access the
> map values, this is highly inefficient both in memory and time and you
> should use a QMap::const_iterator in these cases
Fixed in r1047398, thanks for the hint.
Greetings
Stefan
["signature.asc" (application/pgp-signature)]
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic