Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core/gzip/deflate.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DeflateBitWriter {

auto flush() -> void {
std::uint64_t word{this->buffer_};
if (std::endian::native == std::endian::big) {
if constexpr (std::endian::native == std::endian::big) {
word = std::byteswap(word);
}

Expand Down Expand Up @@ -542,7 +542,7 @@ class DeflateEncoder {
static auto load_32(const std::uint8_t *data) -> std::uint32_t {
std::uint32_t word{0};
std::memcpy(&word, data, sizeof(word));
if (std::endian::native == std::endian::big) {
if constexpr (std::endian::native == std::endian::big) {
word = std::byteswap(word);
}

Expand All @@ -552,7 +552,7 @@ class DeflateEncoder {
static auto load_64(const std::uint8_t *data) -> std::uint64_t {
std::uint64_t word{0};
std::memcpy(&word, data, sizeof(word));
if (std::endian::native == std::endian::big) {
if constexpr (std::endian::native == std::endian::big) {
word = std::byteswap(word);
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/gzip/inflate.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ class InflateDecoder {
static auto load_word(const std::uint8_t *data) -> std::uint64_t {
std::uint64_t word{0};
std::memcpy(&word, data, sizeof(word));
if (std::endian::native == std::endian::big) {
if constexpr (std::endian::native == std::endian::big) {
word = std::byteswap(word);
}

Expand Down