@@ -926,22 +926,20 @@ pub impl Decoder: serialize::Decoder {
926
926
927
927
impl Json : Eq {
928
928
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) => {
945
943
if d0. len ( ) == d1. len ( ) {
946
944
let mut equal = true ;
947
945
for d0. each |k, v0| {
@@ -960,7 +958,7 @@ impl Json : Eq {
960
958
}
961
959
}
962
960
}
963
- pure fn ne ( & self , other : & Json ) -> bool { !( * self ) . eq ( other) }
961
+ pure fn ne ( & self , other : & Json ) -> bool { !self . eq ( other) }
964
962
}
965
963
966
964
/// Test if two json values are less than one another
@@ -1007,7 +1005,7 @@ impl Json : Ord {
1007
1005
let mut d0_flat = ~[ ] ;
1008
1006
let mut d1_flat = ~[ ] ;
1009
1007
1010
- // XXX : this is horribly inefficient...
1008
+ // FIXME #4430 : this is horribly inefficient...
1011
1009
for d0. each |k, v| {
1012
1010
d0_flat. push ( ( @copy * k, @copy * v) ) ;
1013
1011
}
0 commit comments