Commit 0e79537d30f9dd66ccef70f1c7571594088e30be

Authored by Cong Ding
Committed by Theodore Ts'o
1 parent f116700971

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: Cong Ding <dinggnu@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -155,11 +155,11 @@
155 155 /* Check to see if the seed is all zero's */
156 156 if (hinfo->seed) {
157 157 for (i = 0; i < 4; i++) {
158   - if (hinfo->seed[i])
  158 + if (hinfo->seed[i]) {
  159 + memcpy(buf, hinfo->seed, sizeof(buf));
159 160 break;
  161 + }
160 162 }
161   - if (i < 4)
162   - memcpy(buf, hinfo->seed, sizeof(buf));
163 163 }
164 164  
165 165 switch (hinfo->hash_version) {