Remove offset_inbounds for an unsafe offset function

This commit is contained in:
Alex Crichton
2013-08-08 22:22:52 -07:00
parent 578e680477
commit e3662b1880
9 changed files with 37 additions and 109 deletions

View File

@@ -896,7 +896,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
lifetime: cast::transmute(p)}
} else {
VecIterator{ptr: p,
end: p.offset_inbounds(self.len() as int),
end: p.offset(self.len() as int),
lifetime: cast::transmute(p)}
}
}
@@ -1884,7 +1884,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
lifetime: cast::transmute(p)}
} else {
VecMutIterator{ptr: p,
end: p.offset_inbounds(self.len() as int),
end: p.offset(self.len() as int),
lifetime: cast::transmute(p)}
}
}
@@ -2247,7 +2247,7 @@ macro_rules! iterator {
// same pointer.
cast::transmute(self.ptr as uint + 1)
} else {
self.ptr.offset_inbounds(1)
self.ptr.offset(1)
};
Some(cast::transmute(old))
@@ -2279,7 +2279,7 @@ macro_rules! double_ended_iterator {
// See above for why 'ptr.offset' isn't used
cast::transmute(self.end as uint - 1)
} else {
self.end.offset_inbounds(-1)
self.end.offset(-1)
};
Some(cast::transmute(self.end))
}