Skip to content

Commit dbcff70

Browse files
committed
---
yaml --- r: 130990 b: refs/heads/try c: 7e12e67 h: refs/heads/master v: v3
1 parent cddaeb4 commit dbcff70

File tree

5 files changed

+8
-198
lines changed

5 files changed

+8
-198
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9c68679f2ebd5b165694e9346e4ad96a3e32aceb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
5-
refs/heads/try: fc3b6383ba346dcf243d189fa2d87e2b5f2b9f61
5+
refs/heads/try: 7e12e67936dd2ad12e529278344dab369ccb75a0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/licenseck.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"libsync/mpsc_intrusive.rs", # BSD
4545
"test/bench/shootout-binarytrees.rs", # BSD
4646
"test/bench/shootout-fannkuch-redux.rs", # BSD
47-
"test/bench/shootout-fannkuch-redux-safe.rs", # BSD
4847
"test/bench/shootout-k-nucleotide.rs", # BSD
4948
"test/bench/shootout-mandelbrot.rs", # BSD
5049
"test/bench/shootout-meteor.rs", # BSD

branches/try/src/libcore/slice.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,12 @@ impl<'a,T> MutableSlice<'a, T> for &'a mut [T] {
806806
let mut i: uint = 0;
807807
let ln = self.len();
808808
while i < ln / 2 {
809-
self.swap(i, ln - i - 1);
809+
// Unsafe swap to avoid the bounds check in safe swap.
810+
unsafe {
811+
let pa: *mut T = self.unsafe_mut_ref(i);
812+
let pb: *mut T = self.unsafe_mut_ref(ln - i - 1);
813+
ptr::swap(pa, pb);
814+
}
810815
i += 1;
811816
}
812817
}

branches/try/src/test/bench/shootout-fannkuch-redux-safe.rs

Lines changed: 0 additions & 188 deletions
This file was deleted.

branches/try/src/test/bench/shootout-fannkuch-redux.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,7 @@ impl Perm {
125125

126126

127127
fn reverse(tperm: &mut [i32], mut k: uint) {
128-
let p = tperm.as_mut_ptr();
129-
130-
unsafe {
131-
for off in range(0, k as int / 2) {
132-
std::ptr::swap(p.offset(off), p.offset(k as int - 1 - off));
133-
}
134-
}
128+
tperm.mut_slice_to(k).reverse()
135129
}
136130

137131
fn work(mut perm: Perm, n: uint, max: uint) -> (i32, i32) {

0 commit comments

Comments
 (0)