Skip to content

Commit

Permalink
add repack on hashmap
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelchassot committed Dec 9, 2024
1 parent 62c0ac8 commit 2aaa7b3
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 2aaa7b3

Please sign in to comment.