Skip to content

Commit dd73dd0

Browse files
asdfgraydon
asdf
authored andcommitted
removing checks from vec::bytes::memcpy and memmove as are duplicated from raw::
1 parent 4096c9f commit dd73dd0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libcore/vec.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -2041,9 +2041,7 @@ pub mod bytes {
20412041
* may not overlap.
20422042
*/
20432043
pub fn memcpy(dst: &[mut u8], src: &[const u8], count: uint) {
2044-
assert dst.len() >= count;
2045-
assert src.len() >= count;
2046-
2044+
// Bound checks are done at vec::raw::memcpy.
20472045
unsafe { vec::raw::memcpy(dst, src, count) }
20482046
}
20492047

@@ -2054,9 +2052,7 @@ pub mod bytes {
20542052
* may overlap.
20552053
*/
20562054
pub fn memmove(dst: &[mut u8], src: &[const u8], count: uint) {
2057-
assert dst.len() >= count;
2058-
assert src.len() >= count;
2059-
2055+
// Bound checks are done at vec::raw::memmove.
20602056
unsafe { vec::raw::memmove(dst, src, count) }
20612057
}
20622058
}

0 commit comments

Comments
 (0)