For example I want to check whether the following code can be more concise or not:
for(i = 0; i < map->size; i++){
if(0 < map->bucket[i].n){
p = map->bucket[i].list;
while(p){
h = hash(p->key) % n;
if(bucket[h].list){
new_p = bucket[h].list;
while(new_p->next)new_p = new_p->next;
new_p->next = p;
next = p->next;
p->next = NULL;
p = p->next;
}
else{
bucket[h].list = p;
bucket[h].n++;
next = p->next;
p->next = NULL;
p = p->next;
}
}
}
}
Is there any tool for such kind of task?
It would be of great help to me .