llvm.org GIT mirror llvm / 6a3c4b7
Fix uint -> size_t conversion warning. This warning is disabled for the LLVM build, but external users of the header can still run into this. Patch by Ke Bai git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206629 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 6 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
140140 // better: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
141141 // X*33+c -> X*33^c
142142 static inline unsigned HashString(StringRef Str, unsigned Result = 0) {
143 for (unsigned i = 0, e = Str.size(); i != e; ++i)
143 for (StringRef::size_type i = 0, e = Str.size(); i != e; ++i)
144144 Result = Result * 33 + (unsigned char)Str[i];
145145 return Result;
146146 }