【发布时间】:2011-11-07 17:43:47
【问题描述】:
例如我想检查下面的代码是否可以更简洁:
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;
}
}
}
}
这种任务有什么工具吗?
这对我很有帮助。
【问题讨论】:
-
如果选择更短的变量名会更简洁吗?
-
这是你的工具:codereview.stackexchange.com
-
R u sr tht bng cncs s a gd thng?请问,你确定简洁是件好事吗?
-
警告:这里是Obfuscated C
-
@Mike Kwan:你的意思是codegolf.stackexchange.com
标签: c static-analysis micro-optimization