Skip to content

Commit bd81776

Browse files
committed
---
yaml --- r: 32250 b: refs/heads/dist-snap c: 9518fc7 h: refs/heads/master v: v3
1 parent 512c1a0 commit bd81776

File tree

4 files changed

+13
-70
lines changed

4 files changed

+13
-70
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 45e46f5fc0e78f5855e8870a6e3eb2a0a7e5ae50
10+
refs/heads/dist-snap: 9518fc79eaa9979721abcdb9eaa506a1140cf3fb
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/cargo/cargo.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,9 @@ impl package : cmp::Ord {
4242
if self.versions.lt(other.versions) { return true; }
4343
return false;
4444
}
45-
pure fn le(&&other: package) -> bool {
46-
if self.name.lt(other.name) { return true; }
47-
if other.name.lt(self.name) { return false; }
48-
if self.uuid.lt(other.uuid) { return true; }
49-
if other.uuid.lt(self.uuid) { return false; }
50-
if self.url.lt(other.url) { return true; }
51-
if other.url.lt(self.url) { return false; }
52-
if self.method.lt(other.method) { return true; }
53-
if other.method.lt(self.method) { return false; }
54-
if self.description.lt(other.description) { return true; }
55-
if other.description.lt(self.description) { return false; }
56-
if self.tags.lt(other.tags) { return true; }
57-
if other.tags.lt(self.tags) { return false; }
58-
if self.versions.le(other.versions) { return true; }
59-
return false;
60-
}
61-
pure fn ge(&&other: package) -> bool { !other.lt(self) }
62-
pure fn gt(&&other: package) -> bool { !other.le(self) }
45+
pure fn le(&&other: package) -> bool { !other.lt(self) }
46+
pure fn ge(&&other: package) -> bool { !self.lt(other) }
47+
pure fn gt(&&other: package) -> bool { other.lt(self) }
6348
}
6449

6550
type local_package = {

branches/dist-snap/src/libcore/tuple.rs

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,9 @@ impl<A: Ord, B: Ord> (A, B): Ord {
9696
}
9797
}
9898
}
99-
pure fn le(&&other: (A, B)) -> bool {
100-
match self {
101-
(self_a, self_b) => {
102-
match other {
103-
(other_a, other_b) => {
104-
if self_a.lt(other_a) { return true; }
105-
if other_a.lt(self_a) { return false; }
106-
if self_b.le(other_b) { return true; }
107-
return false;
108-
}
109-
}
110-
}
111-
}
112-
}
113-
pure fn ge(&&other: (A, B)) -> bool { !other.lt(self) }
114-
pure fn gt(&&other: (A, B)) -> bool { !other.ge(self) }
99+
pure fn le(&&other: (A, B)) -> bool { !other.lt(self) }
100+
pure fn ge(&&other: (A, B)) -> bool { !self.lt(other) }
101+
pure fn gt(&&other: (A, B)) -> bool { other.lt(self) }
115102
}
116103

117104
impl<A: Eq, B: Eq, C: Eq> (A, B, C): Eq {
@@ -149,24 +136,9 @@ impl<A: Ord, B: Ord, C: Ord> (A, B, C): Ord {
149136
}
150137
}
151138
}
152-
pure fn le(&&other: (A, B, C)) -> bool {
153-
match self {
154-
(self_a, self_b, self_c) => {
155-
match other {
156-
(other_a, other_b, other_c) => {
157-
if self_a.lt(other_a) { return true; }
158-
if other_a.lt(self_a) { return false; }
159-
if self_b.lt(other_b) { return true; }
160-
if other_b.lt(self_b) { return false; }
161-
if self_c.le(other_c) { return true; }
162-
return false;
163-
}
164-
}
165-
}
166-
}
167-
}
168-
pure fn ge(&&other: (A, B, C)) -> bool { !other.lt(self) }
169-
pure fn gt(&&other: (A, B, C)) -> bool { !other.ge(self) }
139+
pure fn le(&&other: (A, B, C)) -> bool { !other.lt(self) }
140+
pure fn ge(&&other: (A, B, C)) -> bool { !self.lt(other) }
141+
pure fn gt(&&other: (A, B, C)) -> bool { other.lt(self) }
170142
}
171143

172144
#[test]

branches/dist-snap/src/libcore/vec.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,23 +1443,9 @@ pure fn lt<T: Ord>(a: &[T], b: &[T]) -> bool {
14431443
return a_len < b_len;
14441444
}
14451445

1446-
pure fn le<T: Ord>(a: &[T], b: &[T]) -> bool {
1447-
let (a_len, b_len) = (a.len(), b.len());
1448-
let mut end = uint::min(&a_len, &b_len);
1449-
1450-
let mut i = 0;
1451-
while i < end {
1452-
let (c_a, c_b) = (&a[i], &b[i]);
1453-
if *c_a < *c_b { return true; }
1454-
if *c_a > *c_b { return false; }
1455-
i += 1;
1456-
}
1457-
1458-
return a_len <= b_len;
1459-
}
1460-
1461-
pure fn ge<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
1462-
pure fn gt<T: Ord>(a: &[T], b: &[T]) -> bool { !le(b, a) }
1446+
pure fn le<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
1447+
pure fn ge<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
1448+
pure fn gt<T: Ord>(a: &[T], b: &[T]) -> bool { lt(b, a) }
14631449

14641450
impl<T: Ord> &[T]: Ord {
14651451
#[inline(always)]

0 commit comments

Comments
 (0)