Skip to content

Commit

Permalink
Fixed the crc32c codec reserving more memory than necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Feb 5, 2024
1 parent bc1d063 commit 529481a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Fixed the `crc32c` codec reserving more memory than necessary

## [0.11.4] - 2024-02-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/array/codec/bytes_to_bytes/crc32c/crc32c_codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl BytesToBytesCodecTraits for Crc32cCodec {
_parallel: bool,
) -> Result<Vec<u8>, CodecError> {
let checksum = crc32fast::hash(&decoded_value).to_le_bytes();
decoded_value.reserve_exact(decoded_value.len() + checksum.len());
decoded_value.reserve_exact(checksum.len());
decoded_value.extend(&checksum);
Ok(decoded_value)
}
Expand Down

0 comments on commit 529481a

Please sign in to comment.