Commit 02d2c026 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Only initialize variable if we are going to use it

parent 17b23428
...@@ -1204,8 +1204,6 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const ...@@ -1204,8 +1204,6 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const
//This function must be super duper ultra fast because it's called thousands of times every few second :( //This function must be super duper ultra fast because it's called thousands of times every few second :(
//I think it should be optomised for role first, hence the switch statement (fastest possible case) //I think it should be optomised for role first, hence the switch statement (fastest possible case)
KFormat format;
if (!index.isValid()) { if (!index.isValid()) {
return QVariant(); return QVariant();
} }
...@@ -1213,6 +1211,7 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const ...@@ -1213,6 +1211,7 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
} }
KFormat format;
switch (role){ switch (role){
case Qt::DisplayRole: { case Qt::DisplayRole: {
KSysGuard::Process *process = reinterpret_cast< KSysGuard::Process * > (index.internalPointer()); KSysGuard::Process *process = reinterpret_cast< KSysGuard::Process * > (index.internalPointer());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment