Skip to content

Commit

Permalink
Refs #10370 Added reserve back to loadAndAddfrom in MDBox.
Browse files Browse the repository at this point in the history
This means the reserve will still be performed if required, but not if memory was already reserved.
  • Loading branch information
ianbush committed Oct 17, 2014
1 parent ec902c6 commit 54ad8c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/MDEvents/src/MDBox.cpp
Expand Up @@ -934,6 +934,9 @@ namespace MDEvents
std::vector<coord_t> TableData;
FileSaver->loadBlock(TableData,filePosition,nEvents);

// convert loaded events to data;
size_t nCurrentEvents = data.size();
this->data.reserve(nCurrentEvents+nEvents); // if space already reserved, e.g. from MergeMDFiles, this does nothing
// convert data to events appending new events to existing
MDE::dataToEvents(TableData,data,false);

Expand Down

0 comments on commit 54ad8c6

Please sign in to comment.