This revision was automatically updated to reflect the committed changes.
Closed by commit rL319132: Remove some duplicated code in UUID.cpp (authored by 
sas).

Repository:
  rL LLVM

https://reviews.llvm.org/D40519

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


Index: lldb/trunk/source/Utility/UUID.cpp
===================================================================
--- lldb/trunk/source/Utility/UUID.cpp
+++ lldb/trunk/source/Utility/UUID.cpp
@@ -74,14 +74,7 @@
 }
 
 void UUID::Dump(Stream *s) const {
-  const uint8_t *u = (const uint8_t *)GetBytes();
-  s->Printf("%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%"
-            "2.2X%2.2X%2.2X%2.2X",
-            u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9], u[10],
-            u[11], u[12], u[13], u[14], u[15]);
-  if (m_num_uuid_bytes == 20) {
-    s->Printf("-%2.2X%2.2X%2.2X%2.2X", u[16], u[17], u[18], u[19]);
-  }
+  s->PutCString(GetAsString().c_str());
 }
 
 bool UUID::SetBytes(const void *uuid_bytes, uint32_t num_uuid_bytes) {


Index: lldb/trunk/source/Utility/UUID.cpp
===================================================================
--- lldb/trunk/source/Utility/UUID.cpp
+++ lldb/trunk/source/Utility/UUID.cpp
@@ -74,14 +74,7 @@
 }
 
 void UUID::Dump(Stream *s) const {
-  const uint8_t *u = (const uint8_t *)GetBytes();
-  s->Printf("%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%"
-            "2.2X%2.2X%2.2X%2.2X",
-            u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9], u[10],
-            u[11], u[12], u[13], u[14], u[15]);
-  if (m_num_uuid_bytes == 20) {
-    s->Printf("-%2.2X%2.2X%2.2X%2.2X", u[16], u[17], u[18], u[19]);
-  }
+  s->PutCString(GetAsString().c_str());
 }
 
 bool UUID::SetBytes(const void *uuid_bytes, uint32_t num_uuid_bytes) {
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to