Skip to content

Commit

Permalink
removing checks from vec::bytes::memcpy and memmove as are duplicated…
Browse files Browse the repository at this point in the history
… from raw::
  • Loading branch information
asdf authored and graydon committed Jan 8, 2013
1 parent 4096c9f commit dd73dd0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libcore/vec.rs
Expand Up @@ -2041,9 +2041,7 @@ pub mod bytes {
* may not overlap.
*/
pub fn memcpy(dst: &[mut u8], src: &[const u8], count: uint) {
assert dst.len() >= count;
assert src.len() >= count;

// Bound checks are done at vec::raw::memcpy.
unsafe { vec::raw::memcpy(dst, src, count) }
}

Expand All @@ -2054,9 +2052,7 @@ pub mod bytes {
* may overlap.
*/
pub fn memmove(dst: &[mut u8], src: &[const u8], count: uint) {
assert dst.len() >= count;
assert src.len() >= count;

// Bound checks are done at vec::raw::memmove.
unsafe { vec::raw::memmove(dst, src, count) }
}
}
Expand Down

0 comments on commit dd73dd0

Please sign in to comment.