Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Nov 29, 2023
1 parent 45db7dd commit 093f6fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/ylt/struct_pack/unpacker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ class unpacker {
else if constexpr (NotSkip) {
item.clear();
if constexpr (can_reserve<type>) {
item.reserve(std::min(size, block_lim_cnt));
item.reserve((std::min)(size, block_lim_cnt));
}
for (size_t i = 0; i < size; ++i) {
item.emplace_back();
Expand Down
2 changes: 1 addition & 1 deletion src/struct_pack/tests/test_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ TEST_CASE("testing broken container size") {
auto ec = struct_pack::deserialize_to(data2, ifi);
CHECK(ec == struct_pack::errc::no_buffer_space);
CHECK(data2.size() == 1 * 1024 * 1024);
CHECK(data2.capacity() == 1 * 1024 * 1024);
CHECK(data2.capacity() < 2 * 1024 * 1024);
}
}
std::filesystem::remove("tmp.data");
Expand Down

0 comments on commit 093f6fe

Please sign in to comment.