Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Also hash the first char, and please sonar by splitting increment to its own expr
[simgrid.git] / teshsuite / smpi / macro-shared / macro-shared.c
index 5c3ee9f..d1d9966 100644 (file)
@@ -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;
 }