@@ -46,7 +46,7 @@ struct crc64 {
4646 }
4747
4848
49- static constexpr inline uint64_t checksum (uint64_t crc_accumulator, const char * data, size_t data_len) noexcept {
49+ static constexpr uint64_t checksum (uint64_t crc_accumulator, const char * data, size_t data_len) noexcept {
5050 auto crc64_table = get_table ();
5151
5252 crc_accumulator = ~crc_accumulator;
@@ -84,10 +84,10 @@ struct crc64 {
8484
8585 using CRC64_table_t = std::array<std::array<uint64_t , 256 >, 8 >;
8686
87- static constexpr inline const CRC64_table_t get_table () noexcept {
87+ static constexpr const CRC64_table_t get_table () noexcept {
8888 auto crc64_itable = get_init_table ();
8989
90- CRC64_table_t crc64_table;
90+ CRC64_table_t crc64_table {{}} ;
9191 crc64_table[0 ] = crc64_itable;
9292
9393 for (uint64_t i = 0 ; i < 256 ; ++i) {
@@ -102,18 +102,14 @@ struct crc64 {
102102 return crc64_table;
103103 }
104104
105- static constexpr inline const std::array<uint64_t , 256 > get_init_table () noexcept {
106- std::array<uint64_t , 256 > data;
105+ static constexpr const std::array<uint64_t , 256 > get_init_table () noexcept {
106+ std::array<uint64_t , 256 > data {{}} ;
107107
108108 for (uint64_t i {0 }; i < 256 ; ++i) {
109109 uint64_t crc {i};
110110
111111 for (uint64_t j {0 }; j < 8 ; ++j) {
112- if (crc & 1 ) {
113- crc = (crc >> 1 ) ^ POLY;
114- } else {
115- crc >>= 1 ;
116- }
112+ crc = (crc & 1 ) ? ((crc >> 1 ) ^ POLY) : (crc >> 1 );
117113 }
118114
119115 data[i] = crc;
0 commit comments