[Lldb-commits] [PATCH] D40536: Simplify UUID constructors

Stephane Sezer via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 27 18:14:02 PST 2017


sas created this revision.

This remove a small amount of duplicated code.


https://reviews.llvm.org/D40536

Files:
  source/Utility/UUID.cpp


Index: source/Utility/UUID.cpp
===================================================================
--- source/Utility/UUID.cpp
+++ source/Utility/UUID.cpp
@@ -21,11 +21,10 @@
 
 namespace lldb_private {
 
-UUID::UUID() : m_num_uuid_bytes(16) { ::memset(m_uuid, 0, sizeof(m_uuid)); }
+UUID::UUID() { Clear(); }
 
 UUID::UUID(const UUID &rhs) {
-  m_num_uuid_bytes = rhs.m_num_uuid_bytes;
-  ::memcpy(m_uuid, rhs.m_uuid, sizeof(m_uuid));
+  SetBytes(rhs.m_uuid, rhs.m_num_uuid_bytes);
 }
 
 UUID::UUID(const void *uuid_bytes, uint32_t num_uuid_bytes) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40536.124506.patch
Type: text/x-patch
Size: 551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171128/cd56cb23/attachment.bin>


More information about the lldb-commits mailing list