mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 10:22:50 +00:00
kcachegrind: use loop-local variables
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
63fcd7b8ab
commit
e82f781202
3 changed files with 7 additions and 10 deletions
|
@ -130,11 +130,10 @@ int main(int argc, char** argv)
|
|||
for ( it = d->functionMap().begin(); it != d->functionMap().end(); ++it )
|
||||
flist.append(&(*it));
|
||||
|
||||
TraceFunction *f;
|
||||
foreach(f, d->functionCycles())
|
||||
foreach(TraceFunction *f, d->functionCycles())
|
||||
flist.append(f);
|
||||
|
||||
foreach(f, flist) {
|
||||
foreach(TraceFunction *f, flist) {
|
||||
if (sortByCount)
|
||||
hc.addCost(f, f->calledCount());
|
||||
else if (sortByExcl)
|
||||
|
@ -149,7 +148,7 @@ int main(int argc, char** argv)
|
|||
|
||||
out.setFieldAlignment(QTextStream::AlignRight);
|
||||
for(int i=0; i<hc.realCount(); i++) {
|
||||
f = (TraceFunction*)hc[i];
|
||||
TraceFunction *f = (TraceFunction*)hc[i];
|
||||
|
||||
if (showCalls) {
|
||||
if (i>0) out << endl;
|
||||
|
|
|
@ -3659,13 +3659,12 @@ ProfileCostArray* TraceData::search(ProfileContext::Type t, QString name,
|
|||
|
||||
TraceFunctionCycle* TraceData::functionCycle(TraceFunction* f)
|
||||
{
|
||||
TraceFunctionCycle* cycle;
|
||||
foreach(cycle, _functionCycles)
|
||||
foreach(TraceFunctionCycle* cycle, _functionCycles)
|
||||
if (cycle->base() == f)
|
||||
return cycle;
|
||||
|
||||
_functionCycleCount++;
|
||||
cycle = new TraceFunctionCycle(f, _functionCycleCount);
|
||||
TraceFunctionCycle* cycle = new TraceFunctionCycle(f, _functionCycleCount);
|
||||
|
||||
_functionCycles.append(cycle);
|
||||
return cycle;
|
||||
|
|
|
@ -232,10 +232,9 @@ void PartView::refresh()
|
|||
clear();
|
||||
|
||||
QList<QTreeWidgetItem*> items;
|
||||
QTreeWidgetItem* item;
|
||||
foreach(TracePart* part, _data->parts()) {
|
||||
if (hidden.contains(part)) continue;
|
||||
item = new PartListItem(0, f, _eventType, _groupType, part);
|
||||
QTreeWidgetItem* item = new PartListItem(0, f, _eventType, _groupType, part);
|
||||
items.append(item);
|
||||
}
|
||||
setSortingEnabled(false);
|
||||
|
@ -244,7 +243,7 @@ void PartView::refresh()
|
|||
header()->setSortIndicatorShown(false);
|
||||
header()->resizeSections(QHeaderView::ResizeToContents);
|
||||
|
||||
foreach(item, items) {
|
||||
foreach(QTreeWidgetItem* item, items) {
|
||||
TracePart* part = ((PartListItem*)item)->part();
|
||||
if (hidden.contains(part)) continue;
|
||||
if (part->isActive()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue