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
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 23 Feb 2017 10:40:41 +0000 (11:40 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 23 Feb 2017 10:40:41 +0000 (11:40 +0100)
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");
   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 */
   while (c != 0) {
     *ans = ((*ans << 5) + *ans) + c; /* hash * 33 + c */
-    c    = *(tohash++);
+    tohash++;
+    c = *tohash;
   }
   return NULL;
 }
   }
   return NULL;
 }