Bug #1990
Updated by skyjake almost 10 years ago
Build 1528 fails when compiling building with Qt 4.7, because QMap::firstKey() is not availble.
This loop could be written in a way that doesn't modify @newSprites@:
<pre> int lastFrame = -1;
while(!newSprites.isEmpty())
{
int frame = newSprites.firstKey();
// Insert dummy sprites to fill any gaps in the frame set.
for(int i = lastFrame + 1; i < frame; ++i)
{
group.sprites << new Sprite;
}
group.sprites << newSprites.take(frame);
lastFrame = frame;
}
</pre>
One could simply for()/foreach() over @newSprites@, accessing the map iterator's key() and value().
Even if one would want to modify @newSprites@, there's @QMutableMapIterator@ that doesn't require firstKey().
This loop could be written in a way that doesn't modify @newSprites@:
<pre> int lastFrame = -1;
while(!newSprites.isEmpty())
{
int frame = newSprites.firstKey();
// Insert dummy sprites to fill any gaps in the frame set.
for(int i = lastFrame + 1; i < frame; ++i)
{
group.sprites << new Sprite;
}
group.sprites << newSprites.take(frame);
lastFrame = frame;
}
</pre>
One could simply for()/foreach() over @newSprites@, accessing the map iterator's key() and value().
Even if one would want to modify @newSprites@, there's @QMutableMapIterator@ that doesn't require firstKey().