compare characters directly in term comparison tests
This commit is contained in:
@@ -2300,6 +2300,14 @@ impl MachineState {
|
||||
return Ordering::Greater;
|
||||
}
|
||||
}
|
||||
(
|
||||
HeapCellValue::Addr(Addr::Con(Constant::Char(c1))),
|
||||
HeapCellValue::Addr(Addr::Con(Constant::Char(c2))),
|
||||
) => {
|
||||
if c1 != c2 {
|
||||
return c1.cmp(&c2);
|
||||
}
|
||||
}
|
||||
(
|
||||
HeapCellValue::Addr(Addr::Con(Constant::Atom(atom, _))),
|
||||
HeapCellValue::Addr(Addr::Con(Constant::Char(c))),
|
||||
@@ -2366,8 +2374,10 @@ impl MachineState {
|
||||
HeapCellValue::Addr(Addr::AttrVar(hc1)),
|
||||
HeapCellValue::Addr(Addr::PStrTail(hc2, _)),
|
||||
) => {
|
||||
if hc1 != hc2 {
|
||||
return hc1.cmp(&hc2);
|
||||
}
|
||||
}
|
||||
(HeapCellValue::Addr(Addr::HeapCell(_)), _)
|
||||
| (HeapCellValue::Addr(Addr::AttrVar(_)), _)
|
||||
| (HeapCellValue::Addr(Addr::PStrTail(..)), _) => {
|
||||
|
||||
Reference in New Issue
Block a user