@@ -117,9 +117,8 @@ json::Value ProgressEvent::ToJSON() const {
117
117
body.try_emplace (" cancellable" , false );
118
118
}
119
119
120
- if (m_event_type == progressUpdate) {
120
+ if (m_event_type == progressUpdate)
121
121
EmplaceSafeString (body, " message" , m_message);
122
- }
123
122
124
123
std::string timestamp (llvm::formatv (" {0:f9}" , m_creation_time.count ()));
125
124
EmplaceSafeString (body, " timestamp" , timestamp);
@@ -168,11 +167,10 @@ const ProgressEvent &ProgressEventManager::GetMostRecentEvent() const {
168
167
return m_last_update_event ? *m_last_update_event : m_start_event;
169
168
}
170
169
171
- void ProgressEventManager::Update (uint64_t progress_id, const char * message,
170
+ void ProgressEventManager::Update (uint64_t progress_id, llvm::StringRef message,
172
171
uint64_t completed, uint64_t total) {
173
- if (std::optional<ProgressEvent> event =
174
- ProgressEvent::Create (progress_id, StringRef (message), completed,
175
- total, &GetMostRecentEvent ())) {
172
+ if (std::optional<ProgressEvent> event = ProgressEvent::Create (
173
+ progress_id, message, completed, total, &GetMostRecentEvent ())) {
176
174
if (event->GetEventType () == progressEnd)
177
175
m_finished = true ;
178
176
@@ -232,7 +230,7 @@ void ProgressEventReporter::Push(uint64_t progress_id, const char *message,
232
230
m_unreported_start_events.push (event_manager);
233
231
}
234
232
} else {
235
- it->second ->Update (progress_id, message, completed, total);
233
+ it->second ->Update (progress_id, StringRef ( message) , completed, total);
236
234
if (it->second ->Finished ())
237
235
m_event_managers.erase (it);
238
236
}
0 commit comments