================
@@ -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();
----------------
bulbazord wrote:

```suggestion
  if (auto maybe_start_time = GetAsNanosec(dict, "start_time"))
      client_info.start_time += *maybe_start_time;
```

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