Skip to content

Commit a21f5cf

Browse files
author
Rickard Holmberg
committed
Use IntPtr.Zero instead of null for comparisons with IntPtrs
1 parent 6d736df commit a21f5cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/runtime.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ internal static bool PyObject_IsIterable(IntPtr pointer)
791791
return false;
792792
#endif
793793
IntPtr tp_iter = Marshal.ReadIntPtr(ob_type, TypeOffset.tp_iter);
794-
return tp_iter != null;
794+
return tp_iter != IntPtr.Zero;
795795
}
796796

797797
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
@@ -1449,7 +1449,7 @@ internal static bool PyIter_Check(IntPtr pointer)
14491449
return false;
14501450
#endif
14511451
IntPtr tp_iternext = Marshal.ReadIntPtr(ob_type, TypeOffset.tp_iternext);
1452-
return tp_iternext != null && tp_iternext != _PyObject_NextNotImplemented;
1452+
return tp_iternext != IntPtr.Zero && tp_iternext != _PyObject_NextNotImplemented;
14531453
}
14541454

14551455
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]

0 commit comments

Comments
 (0)