Skip to content

Commit

Permalink
cleanup hashSysV a bit.
Browse files Browse the repository at this point in the history
Don't pass a reference to a StringRef and use a range loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286232 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Nov 8, 2016
1 parent b576a60 commit 174270c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/llvm/Object/ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ ErrorOr<StringRef> ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section,
/// This function returns the hash value for a symbol in the .dynsym section
/// Name of the API remains consistent as specified in the libelf
/// REF : http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash
static inline unsigned hashSysV(StringRef &symbolName) {
inline unsigned hashSysV(StringRef SymbolName) {
unsigned h = 0, g;
for (unsigned i = 0, j = symbolName.size(); i < j; i++) {
h = (h << 4) + symbolName[i];
for (char C : SymbolName) {
h = (h << 4) + C;
g = h & 0xf0000000L;
if (g != 0)
h ^= g >> 24;
Expand Down

0 comments on commit 174270c

Please sign in to comment.