[clang-tools-extra] r347236 - Use digest size instead of hardcoding it.
Kadir Cetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 19 10:06:33 PST 2018
Author: kadircet
Date: Mon Nov 19 10:06:33 2018
New Revision: 347236
URL: http://llvm.org/viewvc/llvm-project?rev=347236&view=rev
Log:
Use digest size instead of hardcoding it.
Modified:
clang-tools-extra/trunk/clangd/index/Serialization.cpp
Modified: clang-tools-extra/trunk/clangd/index/Serialization.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/Serialization.cpp?rev=347236&r1=347235&r2=347236&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/Serialization.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/Serialization.cpp Mon Nov 19 10:06:33 2018
@@ -365,8 +365,8 @@ Expected<IndexFileIn> readRIFF(StringRef
IndexFileIn Result;
if (Chunks.count("hash")) {
Reader Hash(Chunks.lookup("hash"));
- llvm::StringRef Digest = Hash.consume(20);
Result.Digest.emplace();
+ llvm::StringRef Digest = Hash.consume(Result.Digest->size());
std::copy(Digest.bytes_begin(), Digest.bytes_end(), Result.Digest->begin());
}
More information about the cfe-commits
mailing list