[Lldb-commits] [PATCH] D40537: Simplify UUID::IsValid()

Stephane Sezer via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 28 10:11:56 PST 2017

sas added a comment.

In https://reviews.llvm.org/D40537#937862, @clayborg wrote:

> A better solution would be to initialize UUID::m_num_uuid_bytes with zero and only set it to a valid value if we set bytes into it. Then UUID::IsValid() becomes easy:
>   bool UUID::IsValid() const { return m_num_uuid_bytes > 0; }
> This would allows us to actually have a UUID value that is valid and all zeroes. A few comments would need to be fixed as it currently assumes length is 16 or 20.

Yes but the current default constructor of the `UUID` class creates a 16-bytes all-zeroes UUID. I'm not sure I want to be changing the default behavior that the rest of lldb might be depending on currently.


More information about the lldb-commits mailing list