diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-11-23 11:49:28 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-11-23 11:49:28 +0000 |
commit | 8a3c49897f26525bfef41ec32603f3bc74d5c561 (patch) | |
tree | a9a280f454d4cc3943776fb465e1370aa686349a /llvm/lib/Support | |
parent | e5dbdbefca757d836bca74b28df38764ccbd63fe (diff) | |
download | bcm5719-llvm-8a3c49897f26525bfef41ec32603f3bc74d5c561.tar.gz bcm5719-llvm-8a3c49897f26525bfef41ec32603f3bc74d5c561.zip |
[MD5] Use write32le instead of spelling it out with shifts.
No functionality change intended.
llvm-svn: 287757
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/MD5.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/llvm/lib/Support/MD5.cpp b/llvm/lib/Support/MD5.cpp index e589bfd297a..942571eab0f 100644 --- a/llvm/lib/Support/MD5.cpp +++ b/llvm/lib/Support/MD5.cpp @@ -248,33 +248,15 @@ void MD5::final(MD5Result &Result) { memset(&buffer[used], 0, free - 8); lo <<= 3; - buffer[56] = lo; - buffer[57] = lo >> 8; - buffer[58] = lo >> 16; - buffer[59] = lo >> 24; - buffer[60] = hi; - buffer[61] = hi >> 8; - buffer[62] = hi >> 16; - buffer[63] = hi >> 24; + support::endian::write32le(&buffer[56], lo); + support::endian::write32le(&buffer[60], hi); body(makeArrayRef(buffer, 64)); - Result[0] = a; - Result[1] = a >> 8; - Result[2] = a >> 16; - Result[3] = a >> 24; - Result[4] = b; - Result[5] = b >> 8; - Result[6] = b >> 16; - Result[7] = b >> 24; - Result[8] = c; - Result[9] = c >> 8; - Result[10] = c >> 16; - Result[11] = c >> 24; - Result[12] = d; - Result[13] = d >> 8; - Result[14] = d >> 16; - Result[15] = d >> 24; + support::endian::write32le(&Result[0], a); + support::endian::write32le(&Result[4], b); + support::endian::write32le(&Result[8], c); + support::endian::write32le(&Result[12], d); } void MD5::stringifyResult(MD5Result &Result, SmallString<32> &Str) { |