Skip to content

Commit 536d836

Browse files
committed
Fix compact mode guard in ArrayArena byte_size
1 parent e9c17b1 commit 536d836

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/simfil/model/arena.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ArrayArena
122122
* @return The current size, in bytes, of the array arena if serialized.
123123
*/
124124
[[nodiscard]] size_t byte_size() const {
125-
if (compactHeads_) {
125+
if (heads_.empty() && compactHeads_) {
126126
return compactHeads_->byte_size() + data_.byte_size();
127127
}
128128
auto result = heads_.size() * sizeof(CompactArrayChunk);

0 commit comments

Comments
 (0)