Skip to content

Commit f39db53

Browse files
committed
---
yaml --- r: 130358 b: refs/heads/auto c: 7e12e67 h: refs/heads/master v: v3
1 parent fada7e9 commit f39db53

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: fc3b6383ba346dcf243d189fa2d87e2b5f2b9f61
16+
refs/heads/auto: 7e12e67936dd2ad12e529278344dab369ccb75a0
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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/auto/src/test/bench/shootout-fannkuch-redux-safe.rs

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

branches/auto/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)