Skip to content

Commit 6db83ef

Browse files
apply fall through for hash algorithm
1 parent f896cb8 commit 6db83ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

code/logic/myshell.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ uint64_t myshell_hash64(const char *str) {
198198
}
199199

200200
switch (len & 7) {
201-
case 7: hash ^= (uint64_t)data[6] << 48;
202-
case 6: hash ^= (uint64_t)data[5] << 40;
203-
case 5: hash ^= (uint64_t)data[4] << 32;
204-
case 4: hash ^= (uint64_t)data[3] << 24;
205-
case 3: hash ^= (uint64_t)data[2] << 16;
206-
case 2: hash ^= (uint64_t)data[1] << 8;
201+
case 7: hash ^= (uint64_t)data[6] << 48; /* fall through */
202+
case 6: hash ^= (uint64_t)data[5] << 40; /* fall through */
203+
case 5: hash ^= (uint64_t)data[4] << 32; /* fall through */
204+
case 4: hash ^= (uint64_t)data[3] << 24; /* fall through */
205+
case 3: hash ^= (uint64_t)data[2] << 16; /* fall through */
206+
case 2: hash ^= (uint64_t)data[1] << 8; /* fall through */
207207
case 1: hash ^= (uint64_t)data[0];
208208
hash *= m;
209209
}

0 commit comments

Comments
 (0)