Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 19865:f2a3009b528e legacy-trunk
Replace a few places where X->ob_type was compared to &PyXXX_Type with
calls to PyXXX_CheckExact(X).
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 11 Sep 2001 16:13:52 +0000 |
| parents | c0580d8c193e |
| children | bc50581b3d7c |
line wrap: on
line diff
--- a/Objects/floatobject.c Tue Sep 11 15:57:46 2001 +0000 +++ b/Objects/floatobject.c Tue Sep 11 16:13:52 2001 +0000 @@ -775,7 +775,7 @@ for (i = 0, p = &list->objects[0]; i < N_FLOATOBJECTS; i++, p++) { - if (p->ob_type == &PyFloat_Type && p->ob_refcnt != 0) + if (PyFloat_CheckExact(p) && p->ob_refcnt != 0) frem++; } next = list->next; @@ -785,7 +785,7 @@ for (i = 0, p = &list->objects[0]; i < N_FLOATOBJECTS; i++, p++) { - if (p->ob_type != &PyFloat_Type || + if (!PyFloat_CheckExact(p) || p->ob_refcnt == 0) { p->ob_type = (struct _typeobject *) free_list; @@ -818,7 +818,7 @@ for (i = 0, p = &list->objects[0]; i < N_FLOATOBJECTS; i++, p++) { - if (p->ob_type == &PyFloat_Type && + if (PyFloat_CheckExact(p) && p->ob_refcnt != 0) { char buf[100]; PyFloat_AsString(buf, p);
