[FrameData] Avoid iterating keys()
Instead use iterators. Could be changed to using keyBegin or something like that potentially. The destructor is called 400 times on plasmashell startup for me. Before: 250,000ns After: 110,000ns Differential Revision: https://phabricator.kde.org/D4350
This commit is contained in:
parent
fe39905560
commit
d38be811e8
@ -48,8 +48,8 @@ static const int MAX_FRAME_SIZE = 100000;
|
|||||||
|
|
||||||
FrameData::~FrameData()
|
FrameData::~FrameData()
|
||||||
{
|
{
|
||||||
foreach (FrameSvg *frame, references.keys()) {
|
for (auto it = references.constBegin(), end = references.constEnd(); it != end; ++it) {
|
||||||
frame->d->frames.remove(prefix);
|
it.key()->d->frames.remove(prefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user