提交 0e79537d 编写于 作者: C Cong Ding 提交者: Theodore Ts'o

ext4: reduce one "if" comparison in ext4_dirhash()

It is unnecessary to check i<4 after the loop; just do it before the
break.
Signed-off-by: NCong Ding <dinggnu@gmail.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 f1167009
...@@ -155,11 +155,11 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo) ...@@ -155,11 +155,11 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
/* Check to see if the seed is all zero's */ /* Check to see if the seed is all zero's */
if (hinfo->seed) { if (hinfo->seed) {
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (hinfo->seed[i]) if (hinfo->seed[i]) {
memcpy(buf, hinfo->seed, sizeof(buf));
break; break;
} }
if (i < 4) }
memcpy(buf, hinfo->seed, sizeof(buf));
} }
switch (hinfo->hash_version) { switch (hinfo->hash_version) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册