Skip to content

Commit 007caae

Browse files
ericktgraydon
authored andcommitted
---
yaml --- r: 40488 b: refs/heads/dist-snap c: e1a552a h: refs/heads/master v: v3
1 parent 9e428fd commit 007caae

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: e70b4818032176d266be5f8030a7abb26c375228
10+
refs/heads/dist-snap: e1a552a628f13d8325f680327645ee0f446d250c
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/sort.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ pub pure fn merge_sort<T: Copy>(v: &[const T], le: Le<T>) -> ~[T] {
4545
a_ix += 1;
4646
} else { rs.push(b[b_ix]); b_ix += 1; }
4747
}
48-
rs = vec::append(rs, vec::slice(a, a_ix, a_len));
49-
rs = vec::append(rs, vec::slice(b, b_ix, b_len));
50-
return rs;
48+
rs.push_all(vec::slice(a, a_ix, a_len));
49+
rs.push_all(vec::slice(b, b_ix, b_len));
50+
move rs
5151
}
5252
}
5353

@@ -786,11 +786,11 @@ mod test_qsort {
786786

787787
let expected = ~[1, 2, 3];
788788

789-
do sort::quick_sort(names) |x, y| { int::le(*x, *y) };
789+
do quick_sort(names) |x, y| { int::le(*x, *y) };
790790

791791
let immut_names = vec::from_mut(move names);
792792

793-
let pairs = vec::zip(expected, immut_names);
793+
let pairs = vec::zip_slice(expected, immut_names);
794794
for vec::each(pairs) |p| {
795795
let (a, b) = *p;
796796
debug!("%d %d", a, b);
@@ -867,7 +867,7 @@ mod tests {
867867
#[cfg(test)]
868868
mod test_tim_sort {
869869
struct CVal {
870-
val: ~float,
870+
val: float,
871871
}
872872

873873
impl CVal: Ord {
@@ -948,14 +948,14 @@ mod test_tim_sort {
948948
let rng = rand::Rng();
949949
let mut arr = do vec::from_fn(1000) |_i| {
950950
let randVal = rng.gen_float();
951-
CVal { val: ~randVal }
951+
CVal { val: randVal }
952952
};
953953

954954
tim_sort(arr);
955955
fail ~"Guarantee the fail";
956956
}
957957

958-
struct DVal { val: ~uint }
958+
struct DVal { val: uint }
959959

960960
#[cfg(stage0)]
961961
impl DVal: Ord {
@@ -979,7 +979,7 @@ mod test_tim_sort {
979979
let rng = rand::Rng();
980980
let mut arr = do vec::from_fn(500) |_i| {
981981
let randVal = rng.gen_uint();
982-
DVal { val: ~randVal }
982+
DVal { val: randVal }
983983
};
984984

985985
tim_sort(arr);
@@ -1032,7 +1032,7 @@ mod big_tests {
10321032
for uint::range(lo, hi) |i| {
10331033
let n = 1 << i;
10341034
let arr = do vec::from_fn(n) |_i| {
1035-
~rng.gen_float()
1035+
rng.gen_float()
10361036
};
10371037
let arr = vec::to_mut(move arr);
10381038

@@ -1058,7 +1058,7 @@ mod big_tests {
10581058
let size = arr.len();
10591059
let mut idx = 1;
10601060
while idx <= 10 {
1061-
arr[size-idx] = ~rng.gen_float();
1061+
arr[size-idx] = rng.gen_float();
10621062
idx += 1;
10631063
}
10641064
}
@@ -1067,7 +1067,7 @@ mod big_tests {
10671067

10681068
for (n/100).times {
10691069
let idx = rng.gen_uint_range(0, n);
1070-
arr[idx] = ~rng.gen_float();
1070+
arr[idx] = rng.gen_float();
10711071
}
10721072
tim_sort(arr);
10731073
isSorted(arr);
@@ -1079,12 +1079,12 @@ mod big_tests {
10791079
tim_sort(arr); // ~sort
10801080
isSorted(arr);
10811081

1082-
let mut arr = vec::from_elem(n, ~(-0.5));
1082+
let mut arr = vec::from_elem(n, -0.5);
10831083
tim_sort(arr); // =sort
10841084
isSorted(arr);
10851085

10861086
let half = n / 2;
1087-
let mut arr = makeRange(half).map(|i| ~(*i as float));
1087+
let mut arr = makeRange(half).map(|i| *i as float);
10881088
tim_sort(arr); // !sort
10891089
isSorted(arr);
10901090
}

0 commit comments

Comments
 (0)