Skip to content

Commit 928f7da

Browse files
committed
---
yaml --- r: 13629 b: refs/heads/master c: dc3862b h: refs/heads/master i: 13627: a0ac32e v: v3
1 parent 9fa092b commit 928f7da

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3b9848b869c17ca369fc8bc7703e727eb19a211d
2+
refs/heads/master: dc3862bf58297b75a0e3d4dfdf1f66b56f51dd1d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/vec.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,16 +379,21 @@ fn shift<T>(&v: [T]) -> T {
379379
v <-> vv;
380380

381381
unsafe {
382-
let vv = unsafe::to_ptr(vv);
383-
let r <- *vv;
384-
385-
for uint::range(1u, ln) {|i|
386-
// FIXME: this isn't legal, per se...
387-
let r <- *ptr::offset(vv, i);
388-
push(v, r);
382+
let mut rr;
383+
{
384+
let vv = unsafe::to_ptr(vv);
385+
let mut r <- *vv;
386+
387+
for uint::range(1u, ln) {|i|
388+
// FIXME: this isn't legal, per se...
389+
let r <- *ptr::offset(vv, i);
390+
push(v, r);
391+
}
392+
rr <- r;
389393
}
394+
unsafe::set_len(vv, 0u);
390395

391-
r
396+
rr
392397
}
393398
}
394399

0 commit comments

Comments
 (0)