Skip to content

Commit

Permalink
Avoid capturing return values if they are not used.
Browse files Browse the repository at this point in the history
Refs #7994
  • Loading branch information
martyngigg committed Sep 30, 2013
1 parent 0eaa6a8 commit 0be6ab2
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3387,29 +3387,23 @@ void ApplicationWindow::convertTableToWorkspace()
{
Table* t = dynamic_cast<Table*>(activeWindow(TableWindow));
if (!t) return;
MantidTable* mt = dynamic_cast<MantidTable*>(t);
if (!mt)
{
mt = convertTableToTableWorkspace(t);
}
convertTableToTableWorkspace(t);
}

/**
* Convert Table in the active window to a TableWorkspace
* Convert Table in the active window to a MatrixWorkspace
*/
void ApplicationWindow::convertTableToMatrixWorkspace()
{
Table* t = dynamic_cast<Table*>(activeWindow(TableWindow));
if (!t) return;
MantidTable* mt = dynamic_cast<MantidTable*>(t);
if (!mt)
if(auto *mt = dynamic_cast<MantidTable*>(t))
{
mt = convertTableToTableWorkspace(t);
QMap<QString,QString> params;
params["InputWorkspace"] = QString::fromStdString(mt->getWorkspaceName());
mantidUI->executeAlgorithmDlg("ConvertTableToMatrixWorkspace",params);
}
if ( !mt ) return;
QMap<QString,QString> params;
params["InputWorkspace"] = QString::fromStdString(mt->getWorkspaceName());
mantidUI->executeAlgorithmDlg("ConvertTableToMatrixWorkspace",params);
}

/**
Expand Down Expand Up @@ -3486,8 +3480,7 @@ MantidTable* ApplicationWindow::convertTableToTableWorkspace(Table* t)
{
Mantid::API::AnalysisDataService::Instance().add(wsName,tws);
}
MantidTable* mt = new MantidTable(scriptingEnv(), tws, t->objectName(), this);
return mt;
return new MantidTable(scriptingEnv(), tws, t->objectName(), this);
}

Matrix* ApplicationWindow::tableToMatrix(Table* t)
Expand Down

0 comments on commit 0be6ab2

Please sign in to comment.