arangodb / velocypack

A fast and compact format for serialization and storage
Other
420 stars 40 forks source link

fix an overly pessimistic size calculation #90

Closed jsteemann closed 3 years ago

jsteemann commented 3 years ago

Fix an overly pessimistic size calculation in Builder::reserve(). This compared the Buffer's current size with the desired target size, but it should rather have compared with the Buffer's capacity. The change rectifies that, so we can avoid unnecessary calls into Buffer::reserve() now, which would have returned from the call anyway in case enough Buffer capacity was still available to satisfy the reserve request.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.02%) to 96.458% when pulling 2a74ccf0409791f7d995fca303acd94fd9e4d79d on bug-fix/fix-overly-pessimistic-size-calculation into 437dc4a58ab01e401b5cbd3004e6e0c54885f5b1 on main.