@@ -183,35 +183,35 @@ void ParseEvents(std::vector<std::vector<Event>>& events,
183
183
if (g_profiler_place == " " ) return ;
184
184
185
185
std::string sorted_domain;
186
- std::function<bool (EventItem&, EventItem&)> sorted_func;
186
+ std::function<bool (const EventItem&, const EventItem&)> sorted_func;
187
187
switch (sorted_by) {
188
188
case EventSortingKey::kCalls :
189
189
sorted_domain = " number of calls" ;
190
- sorted_func = [](EventItem& a, EventItem& b) {
190
+ sorted_func = [](const EventItem& a, const EventItem& b) {
191
191
return a.calls > b.calls ;
192
192
};
193
193
break ;
194
194
case EventSortingKey::kTotal :
195
195
sorted_domain = " total time" ;
196
- sorted_func = [](EventItem& a, EventItem& b) {
196
+ sorted_func = [](const EventItem& a, const EventItem& b) {
197
197
return a.total_time > b.total_time ;
198
198
};
199
199
break ;
200
200
case EventSortingKey::kMin :
201
201
sorted_domain = " minimum time" ;
202
- sorted_func = [](EventItem& a, EventItem& b) {
202
+ sorted_func = [](const EventItem& a, const EventItem& b) {
203
203
return a.min_time > b.min_time ;
204
204
};
205
205
break ;
206
206
case EventSortingKey::kMax :
207
207
sorted_domain = " maximum time" ;
208
- sorted_func = [](EventItem& a, EventItem& b) {
208
+ sorted_func = [](const EventItem& a, const EventItem& b) {
209
209
return a.max_time > b.max_time ;
210
210
};
211
211
break ;
212
212
case EventSortingKey::kAve :
213
213
sorted_domain = " average time" ;
214
- sorted_func = [](EventItem& a, EventItem& b) {
214
+ sorted_func = [](const EventItem& a, const EventItem& b) {
215
215
return a.ave_time > b.ave_time ;
216
216
};
217
217
break ;
0 commit comments