File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -2188,10 +2188,8 @@ impl Global {
2188
2188
2189
2189
let range_size = if let Some ( size) = size {
2190
2190
size
2191
- } else if offset > buffer. size {
2192
- 0
2193
2191
} else {
2194
- buffer. size - offset
2192
+ buffer. size . saturating_sub ( offset)
2195
2193
} ;
2196
2194
2197
2195
if offset % wgt:: MAP_ALIGNMENT != 0 {
Original file line number Diff line number Diff line change @@ -439,10 +439,8 @@ impl Buffer {
439
439
) -> Result < SubmissionIndex , ( BufferMapOperation , BufferAccessError ) > {
440
440
let range_size = if let Some ( size) = size {
441
441
size
442
- } else if offset > self . size {
443
- 0
444
442
} else {
445
- self . size - offset
443
+ self . size . saturating_sub ( offset)
446
444
} ;
447
445
448
446
if offset % wgt:: MAP_ALIGNMENT != 0 {
You can’t perform that action at this time.
0 commit comments