bytestring.c: Delete unused buffer methods on `C.ByteString'.
[catacomb-python] / algorithms.c
index 31bd95b..886c159 100644 (file)
@@ -193,9 +193,9 @@ static PyObject *ksget_min(PyObject *me, void *hunoz)
 {
   PyObject *set = ((keyszset_pyobj *)me)->set;
   int i, n, y, x = -1;
-  n = PyTuple_Size(set);
+  n = PyTuple_GET_SIZE(set);
   for (i = 0; i < n; i++) {
-    y = PyInt_AsLong(PyTuple_GetItem(set, i));
+    y = PyInt_AS_LONG(PyTuple_GET_ITEM(set, i));
     if (x == -1 || y < x) x = y;
   }
   return (PyInt_FromLong(x));
@@ -205,9 +205,9 @@ static PyObject *ksget_max(PyObject *me, void *hunoz)
 {
   PyObject *set = ((keyszset_pyobj *)me)->set;
   int i, n, y, x = -1;
-  n = PyTuple_Size(set);
+  n = PyTuple_GET_SIZE(set);
   for (i = 0; i < n; i++) {
-    y = PyInt_AsLong(PyTuple_GetItem(set, i));
+    y = PyInt_AS_LONG(PyTuple_GET_ITEM(set, i));
     if (y > x) x = y;
   }
   return (PyInt_FromLong(x));