Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the scope of some variables to please codacy
[simgrid.git] / include / xbt / str.h
index 0f10bef..c89cf98 100644 (file)
@@ -55,11 +55,10 @@ static inline unsigned int xbt_str_hash_ext(const char *str, int str_len)
 {
 #ifdef XBT_DJB2_HASH_FUNCTION
   /* fast implementation of djb2 algorithm */
-  int c;
   unsigned int hash = 5381;
 
   while (str_len--) {
-    c = *str++;
+    int c = *str++;
     hash = ((hash << 5) + hash) + c;    /* hash * 33 + c */
   }
 # elif defined(XBT_FNV_HASH_FUNCTION)