diff --git a/src/runtime/Types/ClassBase.cs b/src/runtime/Types/ClassBase.cs index f726e931c..f9b974d59 100644 --- a/src/runtime/Types/ClassBase.cs +++ b/src/runtime/Types/ClassBase.cs @@ -94,8 +94,6 @@ public virtual NewReference type_subscript(BorrowedReference idx) public static NewReference tp_richcompare(BorrowedReference ob, BorrowedReference other, int op) { CLRObject co1; - CLRObject? co2; - object co1Inst; object co2Inst; NewReference error; BorrowedReference tp = Runtime.PyObject_TYPE(ob); @@ -130,9 +128,7 @@ public static NewReference tp_richcompare(BorrowedReference ob, BorrowedReferenc return new NewReference(pytrue); } - TryGetSecondCompareOperandInstance(ob, other, out co1, out co2Inst); - - if (co2Inst == null) + if (!TryGetSecondCompareOperandInstance(ob, other, out co1, out co2Inst)) { return new NewReference(pyfalse); }