Skip to content

Commit 457d9a3

Browse files
committed
---
yaml --- r: 38395 b: refs/heads/try c: 3e7da96 h: refs/heads/master i: 38393: 1725045 38391: 67f49a5 v: v3
1 parent 30f4018 commit 457d9a3

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
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: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 30c308b952def6b0967c88556e153f1507fb3529
5+
refs/heads/try: 3e7da96fd22faf8587c1717e03a988dce6893bdb
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/libstd/json.rs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -926,22 +926,20 @@ pub impl Decoder: serialize::Decoder {
926926

927927
impl Json : Eq {
928928
pure fn eq(&self, other: &Json) -> bool {
929-
// XXX: This is ugly because matching on references is broken, and
930-
// we can't match on dereferenced tuples without a copy.
931-
match (*self) {
932-
Number(f0) =>
933-
match *other { Number(f1) => f0 == f1, _ => false },
934-
String(ref s0) =>
935-
match *other { String(ref s1) => s0 == s1, _ => false },
936-
Boolean(b0) =>
937-
match *other { Boolean(b1) => b0 == b1, _ => false },
938-
Null =>
939-
match *other { Null => true, _ => false },
940-
List(ref v0) =>
941-
match *other { List(ref v1) => v0 == v1, _ => false },
942-
Object(ref d0) => {
943-
match *other {
944-
Object(ref d1) => {
929+
match (self) {
930+
&Number(f0) =>
931+
match other { &Number(f1) => f0 == f1, _ => false },
932+
&String(ref s0) =>
933+
match other { &String(ref s1) => s0 == s1, _ => false },
934+
&Boolean(b0) =>
935+
match other { &Boolean(b1) => b0 == b1, _ => false },
936+
&Null =>
937+
match other { &Null => true, _ => false },
938+
&List(ref v0) =>
939+
match other { &List(ref v1) => v0 == v1, _ => false },
940+
&Object(ref d0) => {
941+
match other {
942+
&Object(ref d1) => {
945943
if d0.len() == d1.len() {
946944
let mut equal = true;
947945
for d0.each |k, v0| {
@@ -960,7 +958,7 @@ impl Json : Eq {
960958
}
961959
}
962960
}
963-
pure fn ne(&self, other: &Json) -> bool { !(*self).eq(other) }
961+
pure fn ne(&self, other: &Json) -> bool { !self.eq(other) }
964962
}
965963

966964
/// Test if two json values are less than one another
@@ -1007,7 +1005,7 @@ impl Json : Ord {
10071005
let mut d0_flat = ~[];
10081006
let mut d1_flat = ~[];
10091007

1010-
// XXX: this is horribly inefficient...
1008+
// FIXME #4430: this is horribly inefficient...
10111009
for d0.each |k, v| {
10121010
d0_flat.push((@copy *k, @copy *v));
10131011
}

0 commit comments

Comments
 (0)