Use a new macro, PySequence_Fast_ITEMS to factor out code common to
three recent optimizations. Aside from reducing code volume, it
increases readability.
diff --git a/Include/abstract.h b/Include/abstract.h
index 46aee29..bc9df05 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -1016,6 +1016,12 @@
need to be corrected for a negative index
*/
+#define _PySequence_Fast_ITEMS(sf) \
+ (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
+ : ((PyTupleObject *)(sf))->ob_item)
+ /* Return a pointer to the underlying item array for
+ an object retured by PySequence_Fast */
+
PyAPI_FUNC(int) PySequence_Count(PyObject *o, PyObject *value);
/*