From: Jan Korous Date: Mon, 19 Mar 2018 20:26:15 +0000 (+0000) Subject: [clangd][nfc] Give name to a magic constant X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee1f4586f6e8cdf29f29677c2ac89dfd9f006be0;p=platform%2Fupstream%2Fllvm.git [clangd][nfc] Give name to a magic constant llvm-svn: 327901 --- diff --git a/clang-tools-extra/clangd/index/Index.h b/clang-tools-extra/clangd/index/Index.h index d17537a..7da3a50 100644 --- a/clang-tools-extra/clangd/index/Index.h +++ b/clang-tools-extra/clangd/index/Index.h @@ -56,16 +56,18 @@ public: } private: + static constexpr unsigned HashByteLength = 20; + friend llvm::hash_code hash_value(const SymbolID &ID) { // We already have a good hash, just return the first bytes. - static_assert(sizeof(size_t) <= 20, "size_t longer than SHA1!"); + static_assert(sizeof(size_t) <= HashByteLength, "size_t longer than SHA1!"); return *reinterpret_cast(ID.HashValue.data()); } friend llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const SymbolID &ID); friend void operator>>(llvm::StringRef Str, SymbolID &ID); - std::array HashValue; + std::array HashValue; }; // Write SymbolID into the given stream. SymbolID is encoded as a 40-bytes