diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-02-29 21:02:05 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-02-29 21:02:05 +0000 |
commit | 88e48e7d58eeb138e30ce21592eb903c7f193c42 (patch) | |
tree | d88a8dfc0dce151586defac1f3b44ceac7eae86f /include | |
parent | 95b38aea959449461a9245b0a199758982125f01 (diff) | |
download | external_llvm-88e48e7d58eeb138e30ce21592eb903c7f193c42.zip external_llvm-88e48e7d58eeb138e30ce21592eb903c7f193c42.tar.gz external_llvm-88e48e7d58eeb138e30ce21592eb903c7f193c42.tar.bz2 |
BitstreamWriter: Use SmallVector::append instead of multiple push_back calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151755 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Bitcode/BitstreamWriter.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index 55e3cd3..42c68aa 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -74,10 +74,12 @@ class BitstreamWriter { } 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 { |