Skip to content

Commit

Permalink
Standardize crc32_stub
Browse files Browse the repository at this point in the history
Reorganize statements inside crc32_stub() to match more closely the format
used for other function stubs in functable.c.
  • Loading branch information
mscastanho committed Aug 11, 2021
1 parent 747ffeb commit a56f926
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions functable.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ Z_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t
"crc32_z takes size_t but internally we have a uint64_t len");
/* return a function pointer for optimized arches here after a capability test */

functable.crc32 = &crc32_generic;
cpu_check_features();

if (use_byfour) {
Expand All @@ -485,8 +486,6 @@ Z_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t
#else
# error No endian defined
#endif
} else {
functable.crc32 = crc32_generic;
}

return functable.crc32(crc, buf, len);
Expand Down

0 comments on commit a56f926

Please sign in to comment.