================
@@ -148,23 +161,14 @@ void TelemetryManager::DispatchClientTelemetry(
     LLDB_LOG(GetLog(LLDBLog::Object),
              "Cannot determine client_data from client-telemetry entry");
 
-  int64_t start_time;
-  if (dict->GetValueForKeyAsInteger("start_time", start_time)) {
-    client_info.start_time +=
-        std::chrono::nanoseconds(static_cast<size_t>(start_time));
-  } else {
-    LLDB_LOG(GetLog(LLDBLog::Object),
-             "Cannot determine start-time from client-telemetry entry");
-  }
+  auto start_time = GetAsNanosec(dict, "start_time");
+  if (start_time.has_value())
+    client_info.start_time += start_time.value();
 
-  int64_t end_time;
-  if (dict->GetValueForKeyAsInteger("end_time", end_time)) {
+  auto end_time = GetAsNanosec(dict, "end_time");
+  if (end_time.has_value()) {
     SteadyTimePoint epoch;
-    client_info.end_time =
-        epoch + std::chrono::nanoseconds(static_cast<size_t>(end_time));
-  } else {
-    LLDB_LOG(GetLog(LLDBLog::Object),
-             "Cannot determine end-time from client-telemetry entry");
+    client_info.end_time = epoch + end_time.value();
----------------
bulbazord wrote:

Same suggestion here.

https://github.com/llvm/llvm-project/pull/145954
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to