Fix bug in pvec `pop` resulting in empty tail
When calling pop on a persistent vector with, eg., 33 elements, we have a tail of length 1. After this pop call, there was a bug where the resulting pvec had a tail of length 0 rather than a tail of length 32. This causes errors, for instance when calling iterate, which expects a nonempty tail. This PR fixes the behavior by adding a branch in pop function for when the tail length is currently 1 (in which case we make the new tail be pop(trie)).
(just added a test for this behavior)
Codecov Report
Merging #64 into master will increase coverage by
1.07%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #64 +/- ##
==========================================
+ Coverage 77.30% 78.38% +1.07%
==========================================
Files 7 7
Lines 379 384 +5
==========================================
+ Hits 293 301 +8
+ Misses 86 83 -3
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/PersistentVector.jl | 76.62% <100.00%> (+3.01%) |
:arrow_up: |
| src/BitmappedVectorTrie.jl | 72.81% <0.00%> (+1.94%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 2dd9b36...2bafd37. Read the comment docs.