mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
remove no-longer-needed zero checks
This commit is contained in:
+2
-8
@@ -175,10 +175,7 @@ fn read(
|
||||
.to_machine_usize(&*this.tcx)?
|
||||
.min((1 << (ptr_size - 1)) - 1) // max value of target `isize`
|
||||
.min(isize::max_value() as u64);
|
||||
// Reading zero bytes should not change `buf`.
|
||||
if count == 0 {
|
||||
return Ok(0);
|
||||
}
|
||||
|
||||
let fd = this.read_scalar(fd_op)?.to_i32()?;
|
||||
let buf = this.read_scalar(buf_op)?.not_undef()?;
|
||||
|
||||
@@ -231,10 +228,7 @@ fn write(
|
||||
.to_machine_usize(&*this.tcx)?
|
||||
.min((1 << (ptr_size - 1)) - 1) // max value of target `isize`
|
||||
.min(isize::max_value() as u64);
|
||||
// Writing zero bytes should not change `buf`.
|
||||
if count == 0 {
|
||||
return Ok(0);
|
||||
}
|
||||
|
||||
let fd = this.read_scalar(fd_op)?.to_i32()?;
|
||||
let buf = this.read_scalar(buf_op)?.not_undef()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user