Palapeli -> kdereview
Stefan Majewsky
majewsky at gmx.net
Wed Nov 11 09:13:36 GMT 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20091111/72b841f1/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-games-devel mailing list
kde-games-devel at kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel
More information about the kde-core-devel
mailing list