From ed23ac2bff8fcad35229de335d7a42d7fa65d53e Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 23 Feb 2017 11:40:41 +0100 Subject: [PATCH] Also hash the first char, and please sonar by splitting increment to its own expr --- teshsuite/smpi/macro-shared/macro-shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teshsuite/smpi/macro-shared/macro-shared.c b/teshsuite/smpi/macro-shared/macro-shared.c index 5c3ee9fe5d..d1d9966e82 100644 --- a/teshsuite/smpi/macro-shared/macro-shared.c +++ b/teshsuite/smpi/macro-shared/macro-shared.c @@ -16,10 +16,11 @@ static void* hash(char *str, uint64_t* ans) char *tohash = str; *ans=5381; printf("hashing !\n"); - int c = *(tohash++); + int c = *tohash; while (c != 0) { *ans = ((*ans << 5) + *ans) + c; /* hash * 33 + c */ - c = *(tohash++); + tohash++; + c = *tohash; } return NULL; } -- 2.20.1