From: Damien Guibouret Date: Thu, 7 Sep 2017 01:53:32 +0000 (-0400) Subject: libext2fs: remove useless test and assignment in strtohashbuf() X-Git-Tag: v1.44.0-rc1~45 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=7595699d09d32863b40deac1190e5c2b091efb36;p=tools%2Fe2fsprogs.git libext2fs: remove useless test and assignment in strtohashbuf() On transformation of str to hash, computed value is initialised before first byte modulo 4. But it is already initialised before entering loop and after processing last byte modulo 4. So the corresponding test and initialisation could be removed. Signed-off-by: Damien Guibouret Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/dirhash.c b/lib/ext2fs/dirhash.c index c4ac94e..4ba3f35 100644 --- a/lib/ext2fs/dirhash.c +++ b/lib/ext2fs/dirhash.c @@ -154,8 +154,6 @@ static void str2hashbuf(const char *msg, int len, __u32 *buf, int num, if (len > num*4) len = num * 4; for (i=0; i < len; i++) { - if ((i % 4) == 0) - val = pad; if (unsigned_flag) c = (int) ucp[i]; else