Limits the range so that it doesn't exceed the virtual size of the file.
(&self, address: u64, count: usize)
| 1351 | |
| 1352 | // Limits the range so that it doesn't exceed the virtual size of the file. |
| 1353 | fn limit_range_file(&self, address: u64, count: usize) -> usize { |
| 1354 | if address.checked_add(count as u64).is_none() || address > self.virtual_size() { |
| 1355 | return 0; |
| 1356 | } |
| 1357 | min(count as u64, self.virtual_size() - address) as usize |
| 1358 | } |
| 1359 | |
| 1360 | // Limits the range so that it doesn't overflow the end of a cluster. |
| 1361 | fn limit_range_cluster(&self, address: u64, count: usize) -> usize { |
no test coverage detected