Skip to content

Commit 2e3d339

Browse files
committed
---
yaml --- r: 4348 b: refs/heads/master c: 40c1b86 h: refs/heads/master v: v3
1 parent d61531c commit 2e3d339

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 091a2c2f71c693cc90c5bfb44b18a8092dba4af4
2+
refs/heads/master: 40c1b864c60cb4dc501f78c9963b22469bb6c345

trunk/src/comp/middle/trans.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,29 +2720,22 @@ fn trans_compare(cx0: &@block_ctxt, op: ast::binop, t0: &ty::t,
27202720
let rhs = rhs_r.val;
27212721
cx = rhs_r.bcx;
27222722
// Determine the operation we need.
2723-
// FIXME: Use or-patterns when we have them.
27242723

27252724
let llop;
27262725
alt op {
2727-
ast::eq. { llop = C_u8(abi::cmp_glue_op_eq); }
2728-
ast::lt. { llop = C_u8(abi::cmp_glue_op_lt); }
2729-
ast::le. { llop = C_u8(abi::cmp_glue_op_le); }
2730-
ast::ne. { llop = C_u8(abi::cmp_glue_op_eq); }
2731-
ast::ge. { llop = C_u8(abi::cmp_glue_op_lt); }
2732-
ast::gt. { llop = C_u8(abi::cmp_glue_op_le); }
2726+
ast::eq. | ast::ne. { llop = C_u8(abi::cmp_glue_op_eq); }
2727+
ast::lt. | ast::ge. { llop = C_u8(abi::cmp_glue_op_lt); }
2728+
ast::le. | ast::gt. { llop = C_u8(abi::cmp_glue_op_le); }
27332729
}
27342730
let rs = compare(cx, lhs, rhs, rhs_r.ty, llop);
27352731

27362732

27372733
// Invert the result if necessary.
2738-
// FIXME: Use or-patterns when we have them.
27392734
alt op {
2740-
ast::eq. { ret rslt(rs.bcx, rs.val); }
2741-
ast::lt. { ret rslt(rs.bcx, rs.val); }
2742-
ast::le. { ret rslt(rs.bcx, rs.val); }
2743-
ast::ne. { ret rslt(rs.bcx, rs.bcx.build.Not(rs.val)); }
2744-
ast::ge. { ret rslt(rs.bcx, rs.bcx.build.Not(rs.val)); }
2745-
ast::gt. { ret rslt(rs.bcx, rs.bcx.build.Not(rs.val)); }
2735+
ast::eq. | ast::lt. | ast::le. { ret rslt(rs.bcx, rs.val); }
2736+
ast::ne. | ast::ge. | ast::gt. {
2737+
ret rslt(rs.bcx, rs.bcx.build.Not(rs.val));
2738+
}
27462739
}
27472740
}
27482741

0 commit comments

Comments
 (0)