Skip to content

Commit

Permalink
Add repack to hashmap (#117)
Browse files Browse the repository at this point in the history
* add repack on hashmap

* ci update
  • Loading branch information
samuelchassot authored Dec 16, 2024
1 parent 3fadc81 commit 156890f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ object MutableHashMap {

}.ensuring (res => valid && (if (res) map.eq(old(this).map - key) else map.eq(old(this).map)))

def repack(): Boolean = {
require(valid)
this.underlying.v.repack()
}.ensuring (res => res == false || map == old(this).map)

@ghost
override def valid: Boolean = underlying.v.valid &&
underlying.v.map.toList.forall((k, v) => noDuplicateKeys(v)) &&
Expand Down

0 comments on commit 156890f

Please sign in to comment.