We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a49b1b commit cc4c09cCopy full SHA for cc4c09c
api/include/opentelemetry/trace/span_id.h
@@ -61,7 +61,8 @@ class SpanId final
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};
65
+ return memcmp(rep_, kEmptyRep, kSize) != 0;
66
}
67
68
// Copies the opaque SpanId data to dest.
0 commit comments