[Lldb-commits] [lldb] r319191 - Simplify UUID constructors

Stephane Sezer via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 28 09:50:31 PST 2017


Author: sas
Date: Tue Nov 28 09:50:31 2017
New Revision: 319191

URL: http://llvm.org/viewvc/llvm-project?rev=319191&view=rev
Log:
Simplify UUID constructors

Summary: This remove a small amount of duplicated code.

Reviewers: clayborg, zturner, davide

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D40536

Modified:
    lldb/trunk/source/Utility/UUID.cpp

Modified: lldb/trunk/source/Utility/UUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/UUID.cpp?rev=319191&r1=319190&r2=319191&view=diff
==============================================================================
--- lldb/trunk/source/Utility/UUID.cpp (original)
+++ lldb/trunk/source/Utility/UUID.cpp Tue Nov 28 09:50:31 2017
@@ -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) {




More information about the lldb-commits mailing list