Skip to content

Commit 452ab44

Browse files
qinhepingcelinval
andauthored
Update library/core/src/str/pattern.rs
Co-authored-by: Celina G. Val <[email protected]>
1 parent 44196af commit 452ab44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/str/pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ unsafe fn small_slice_eq(x: &[u8], y: &[u8]) -> bool {
19621962
&& crate::ub_checks::same_allocation(y.as_ptr(), py)
19631963
&& px.addr() >= x.addr()
19641964
&& py.addr() >= y.addr()
1965-
&& px as isize - x.as_ptr() as isize == (py as isize - y.as_ptr() as isize))]
1965+
&& px.addr() - x.addr() == py.addr() - y.addr())]
19661966
while px < pxend {
19671967
let vx = (px as *const u32).read_unaligned();
19681968
let vy = (py as *const u32).read_unaligned();

0 commit comments

Comments
 (0)