Skip to content

Commit

Permalink
Refs #4472 simplification of adding two Run's together
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Mar 2, 2012
1 parent a3b934a commit 954fb60
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions Code/Mantid/Framework/API/src/Run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,21 @@ Kernel::Logger& Run::g_log = Kernel::Logger::get("Run");
// Other properties are added to gether if they are on the approved list
for(int i = 0; i < ADDABLES; ++i )
{
// get a pointer to the property on the right-handside workspace
Property * right;
try
{
right = rhs.m_manager.getProperty(ADDABLE[i]);
}
catch (Exception::NotFoundError &)
if (rhs.m_manager.existsProperty(ADDABLE[i]))
{
//if it's not there then ignore it and move on
continue;
}
// now deal with the left-handside
Property * left;
try
{
left = m_manager.getProperty(ADDABLE[i]);
}
catch (Exception::NotFoundError &)
{
//no property on the left-handside, create one and copy the right-handside across verbatum
m_manager.declareProperty(right->clone(), "");
continue;
}

left->operator+=(right);
// get a pointer to the property on the right-handside workspace
Property * right = rhs.m_manager.getProperty();

// now deal with the left-handside
if (m_manager.existsProperty(ADDABLE[i]))
{
Property * left = m_manager.getProperty(ADDABLE[i]);
left->operator+=(right);
}
else
//no property on the left-handside, create one and copy the right-handside across verbatum
m_manager.declareProperty(right->clone(), "");
}
}
return *this;
}
Expand Down

0 comments on commit 954fb60

Please sign in to comment.