@@ -102,8 +102,9 @@ class MANTID_DATAOBJECTS_DLL EventList : public Mantid::API::IEventList {
102
102
* @param event :: TofEvent to add at the end of the list.
103
103
* */
104
104
inline void addEventQuickly (const Types::Event::TofEvent &event) {
105
- this ->events .emplace_back (event);
106
- this ->setSortOrder (UNSORTED);
105
+ this ->events ->emplace_back (event);
106
+ if (this ->order != UNSORTED)
107
+ this ->setSortOrder (UNSORTED);
107
108
}
108
109
109
110
// --------------------------------------------------------------------------
@@ -112,8 +113,9 @@ class MANTID_DATAOBJECTS_DLL EventList : public Mantid::API::IEventList {
112
113
* @param event :: WeightedEvent to add at the end of the list.
113
114
* */
114
115
inline void addEventQuickly (const WeightedEvent &event) {
115
- this ->weightedEvents .emplace_back (event);
116
- this ->setSortOrder (UNSORTED);
116
+ this ->weightedEvents ->emplace_back (event);
117
+ if (this ->order != UNSORTED)
118
+ this ->setSortOrder (UNSORTED);
117
119
}
118
120
119
121
// --------------------------------------------------------------------------
@@ -122,8 +124,9 @@ class MANTID_DATAOBJECTS_DLL EventList : public Mantid::API::IEventList {
122
124
* @param event :: WeightedEventNoTime to add at the end of the list.
123
125
* */
124
126
inline void addEventQuickly (const WeightedEventNoTime &event) {
125
- this ->weightedEventsNoTime .emplace_back (event);
126
- this ->setSortOrder (UNSORTED);
127
+ this ->weightedEventsNoTime ->emplace_back (event);
128
+ if (this ->order != UNSORTED)
129
+ this ->setSortOrder (UNSORTED);
127
130
}
128
131
129
132
Mantid::API::EventType getEventType () const override ;
@@ -326,13 +329,13 @@ class MANTID_DATAOBJECTS_DLL EventList : public Mantid::API::IEventList {
326
329
HistogramData::Histogram m_histogram;
327
330
328
331
// / List of TofEvent (no weights).
329
- mutable std::vector<Types::Event::TofEvent> events;
332
+ mutable std::unique_ptr<std:: vector<Types::Event::TofEvent> > events;
330
333
331
334
// / List of WeightedEvent's
332
- mutable std::vector<WeightedEvent> weightedEvents;
335
+ mutable std::unique_ptr<std:: vector<WeightedEvent> > weightedEvents;
333
336
334
337
// / List of WeightedEvent's
335
- mutable std::vector<WeightedEventNoTime> weightedEventsNoTime;
338
+ mutable std::unique_ptr<std:: vector<WeightedEventNoTime> > weightedEventsNoTime;
336
339
337
340
// / What type of event is in our list.
338
341
Mantid::API::EventType eventType;
0 commit comments