[Support] Use static_assert instead of assert (NFC)

Identified with misc-static-assert.
This commit is contained in:
Kazu Hirata 2021-02-18 22:46:41 -08:00
parent 744a96afed
commit 2d5eb67235
1 changed files with 1 additions and 1 deletions

View File

@ -204,7 +204,7 @@ void SHA256::update(ArrayRef<uint8_t> Data) {
// Fast buffer filling for large inputs.
while (Data.size() >= BLOCK_LENGTH) {
assert(InternalState.BufferOffset == 0);
assert(BLOCK_LENGTH % 4 == 0);
static_assert(BLOCK_LENGTH % 4 == 0, "");
constexpr size_t BLOCK_LENGTH_32 = BLOCK_LENGTH / 4;
for (size_t I = 0; I < BLOCK_LENGTH_32; ++I)
InternalState.Buffer.L[I] = support::endian::read32be(&Data[I * 4]);