@@ -117,9 +117,8 @@ json::Value ProgressEvent::ToJSON() const {
117117 body.try_emplace (" cancellable" , false );
118118 }
119119
120- if (m_event_type == progressUpdate) {
120+ if (m_event_type == progressUpdate)
121121 EmplaceSafeString (body, " message" , m_message);
122- }
123122
124123 std::string timestamp (llvm::formatv (" {0:f9}" , m_creation_time.count ()));
125124 EmplaceSafeString (body, " timestamp" , timestamp);
@@ -168,11 +167,10 @@ const ProgressEvent &ProgressEventManager::GetMostRecentEvent() const {
168167 return m_last_update_event ? *m_last_update_event : m_start_event;
169168}
170169
171- void ProgressEventManager::Update (uint64_t progress_id, const char * message,
170+ void ProgressEventManager::Update (uint64_t progress_id, llvm::StringRef message,
172171 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 ())) {
176174 if (event->GetEventType () == progressEnd)
177175 m_finished = true ;
178176
@@ -232,7 +230,7 @@ void ProgressEventReporter::Push(uint64_t progress_id, const char *message,
232230 m_unreported_start_events.push (event_manager);
233231 }
234232 } else {
235- it->second ->Update (progress_id, message, completed, total);
233+ it->second ->Update (progress_id, StringRef ( message) , completed, total);
236234 if (it->second ->Finished ())
237235 m_event_managers.erase (it);
238236 }
0 commit comments