From b1b2071331f0d88d7661ca9c0ad19b81282071bc Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 19 Jan 2025 22:42:27 +0100 Subject: [PATCH] Optimize PyWeakref_GetRef() (#129) --- pythoncapi_compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythoncapi_compat.h b/pythoncapi_compat.h index 0ea8e80..c533b82 100644 --- a/pythoncapi_compat.h +++ b/pythoncapi_compat.h @@ -583,7 +583,7 @@ static inline int PyWeakref_GetRef(PyObject *ref, PyObject **pobj) return 0; } *pobj = Py_NewRef(obj); - return (*pobj != NULL); + return 1; } #endif