We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9772156 commit 69fdf67Copy full SHA for 69fdf67
api/include/opentelemetry/trace/span_id.h
@@ -60,8 +60,8 @@ class SpanId final
60
// Returns false if the SpanId is all zeros.
61
bool IsValid() const noexcept
62
{
63
- static_assert(kSize == 8, "update is needed if kSize is not 8");
64
- return *reinterpret_cast<const uint64_t *>(&rep_) != 0ull;
+ static constexpr uint8_t kEmptyRep[kSize] = {0};
+ return memcmp(rep_, kEmptyRep, kSize) != 0;
65
}
66
67
// Copies the opaque SpanId data to dest.
0 commit comments