Fix incorrect calculation of free space
when granting a range that spans a token and inserting a new token, the free space on the last token that we are handing over has to change. Add unit test for this too.
This commit is contained in:
1 parent
32c35da402
commit
af5531cbf6
3 files changed
+19
-1
No files matched your search
@@ -52,3 +52,10 @@ func Subtract(a, b Address) Offset {
|
||||
common.Assert(a >= b)
|
||||
return Offset(a - b)
|
||||
}
|
||||
|
||||
func Min(a, b Offset) Offset {
|
||||
if a > b {
|
||||
return b
|
||||
}
|
||||
return a
|
||||
}
|
||||
Reference in new issue
Block a user