File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
branches/snap-stage3/src/libstd Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 66fccdb2958fef88e00236497aec5e0f99fe7d02
4
+ refs/heads/snap-stage3: 2ff84124f0d39b20f49ce04f71d31322cdf1a327
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -2106,7 +2106,8 @@ macro_rules! iterator {
2106
2106
2107
2107
#[ inline]
2108
2108
fn size_hint( & self ) -> ( uint, Option <uint>) {
2109
- let exact = self . indexable( ) ;
2109
+ let diff = ( self . end as uint) - ( self . ptr as uint) ;
2110
+ let exact = diff / sys:: nonzero_size_of:: <T >( ) ;
2110
2111
( exact, Some ( exact) )
2111
2112
}
2112
2113
}
@@ -2139,8 +2140,8 @@ macro_rules! random_access_iterator {
2139
2140
impl <' self , T > RandomAccessIterator <$elem> for $name<' self , T > {
2140
2141
#[ inline]
2141
2142
fn indexable( & self ) -> uint {
2142
- let diff = ( self . end as uint ) - ( self . ptr as uint ) ;
2143
- diff / sys :: nonzero_size_of :: < T > ( )
2143
+ let ( exact , _ ) = self . size_hint ( ) ;
2144
+ exact
2144
2145
}
2145
2146
2146
2147
fn idx( & self , index: uint) -> Option <$elem> {
@@ -2181,7 +2182,6 @@ pub struct VecMutIterator<'self, T> {
2181
2182
}
2182
2183
iterator ! { impl VecMutIterator -> & ' self mut T }
2183
2184
double_ended_iterator ! { impl VecMutIterator -> & ' self mut T }
2184
- random_access_iterator ! { impl VecMutIterator -> & ' self mut T }
2185
2185
pub type MutRevIterator < ' self , T > = Invert < VecMutIterator < ' self , T > > ;
2186
2186
2187
2187
/// An iterator that moves out of a vector.
You can’t perform that action at this time.
0 commit comments