Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Sep 13, 2024
1 parent 298146b commit ac057fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions iguana/pb_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ IGUANA_INLINE void from_pb_impl(T& val, std::string_view& pb_str,
"Invalid fixed int value: too few bytes.");
}

detail::resize(val, size);
// detail::resize(val, size);
val.resize(size);
size_t index = 0;
size_t start = pb_str.size();
while (!pb_str.empty() && index < size) {
from_pb_impl(val[index], pb_str);
index++;
if (start - pb_str.size() == size) {
if (index < size) {
detail::resize(val, index);
// detail::resize(val, index);
val.resize(index);
}
break;
}
Expand Down

0 comments on commit ac057fb

Please sign in to comment.