[llvm-commits] [llvm] r151755 - /llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h
Daniel Dunbar
daniel at zuster.org
Wed Feb 29 13:02:05 PST 2012
Author: ddunbar
Date: Wed Feb 29 15:02:05 2012
New Revision: 151755
URL: http://llvm.org/viewvc/llvm-project?rev=151755&view=rev
Log:
BitstreamWriter: Use SmallVector::append instead of multiple push_back calls.
Modified:
llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h
Modified: llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h?rev=151755&r1=151754&r2=151755&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Wed Feb 29 15:02:05 2012
@@ -74,10 +74,12 @@
}
void WriteWord(unsigned Value) {
- Out.push_back((unsigned char)(Value >> 0));
- Out.push_back((unsigned char)(Value >> 8));
- Out.push_back((unsigned char)(Value >> 16));
- Out.push_back((unsigned char)(Value >> 24));
+ unsigned char Bytes[4] = {
+ (unsigned char)(Value >> 0),
+ (unsigned char)(Value >> 8),
+ (unsigned char)(Value >> 16),
+ (unsigned char)(Value >> 24) };
+ Out.append(&Bytes[0], &Bytes[4]);
}
unsigned GetBufferOffset() const {
More information about the llvm-commits
mailing list