File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
branches/dist-snap/src/libstd Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
9
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10
- refs/heads/dist-snap: a2573290710f4b3f14be475f4ef2af773de7b4c7
10
+ refs/heads/dist-snap: 5aa04635647287481ceca44cf557b698666fa939
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
13
13
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -98,17 +98,14 @@ impl<T: Copy> Deque<T> {
98
98
99
99
/// Grow is only called on full elts, so nelts is also len(elts), unlike
100
100
/// elsewhere.
101
- fn grow < T : Copy > ( nelts : uint , lo : uint , elts : & [ Option < T > ] ) -> ~[ Option < T > ] {
101
+ fn grow < T > ( nelts : uint , lo : uint , elts : & mut [ Option < T > ] ) -> ~[ Option < T > ] {
102
102
assert nelts == elts. len ( ) ;
103
103
let mut rv = ~[ ] ;
104
104
105
- let mut i = 0 u;
106
- let nalloc = uint:: next_power_of_two ( nelts + 1 u) ;
107
- while i < nalloc {
108
- if i < nelts {
109
- rv. push ( elts[ ( lo + i) % nelts] ) ;
110
- } else { rv. push ( None ) ; }
111
- i += 1 u;
105
+ do vec:: grow_fn ( & mut rv, nelts + 1 ) |i| {
106
+ let mut element = None ;
107
+ element <-> elts[ ( lo + i) % nelts] ;
108
+ element
112
109
}
113
110
114
111
rv
You can’t perform that action at this time.
0 commit comments