[llvm] r258540 - Typo fix and simplification.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 11:58:18 PST 2016


Author: rafael
Date: Fri Jan 22 13:58:18 2016
New Revision: 258540

URL: http://llvm.org/viewvc/llvm-project?rev=258540&view=rev
Log:
Typo fix and simplification.

Thanks to Justin Bogner for the suggestion.

Modified:
    llvm/trunk/include/llvm/Support/EndianStream.h

Modified: llvm/trunk/include/llvm/Support/EndianStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/EndianStream.h?rev=258540&r1=258539&r2=258540&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/EndianStream.h (original)
+++ llvm/trunk/include/llvm/Support/EndianStream.h Fri Jan 22 13:58:18 2016
@@ -28,10 +28,8 @@ template <endianness endian> struct Writ
   raw_ostream &OS;
   Writer(raw_ostream &OS) : OS(OS) {}
   template <typename value_type> void write(ArrayRef<value_type> Vals) {
-    for (value_type V : Vals) {
-      value_type Swaped = byte_swap<value_type, endian>(V);
-      OS.write((const char *)&Swaped, sizeof(value_type));
-    }
+    for (value_type V : Vals)
+      write(V);
   }
   template <typename value_type> void write(value_type Val) {
     Val = byte_swap<value_type, endian>(Val);




More information about the llvm-commits mailing list