chiark / gitweb /
field.c, mp.c: Hash `GF' and `FE' objects the same as `MP'.
[catacomb-python] / mp.c
diff --git a/mp.c b/mp.c
index 9330121968644f5eb33f83e9278f82c26d92485c..e4f59804246862d6f71836b4a81fd1e7ac39ce52 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -1887,15 +1887,6 @@ end:
   return ((PyObject *)zz);
 }
 
-static long gf_pyhash(PyObject *me)
-{
-  long i = mp_tolong(MP_X(me));
-  i ^= 0xc7ecd67c; /* random perturbance */
-  if (i == -1)
-    i = -2;
-  return (i);
-}
-
 static PyObject *gf_pyexp(PyObject *x, PyObject *y, PyObject *z)
 {
   mp *xx = 0, *yy = 0, *zz = 0;
@@ -2078,7 +2069,7 @@ static PyTypeObject gf_pytype_skel = {
   &gf_pynumber,                                /* @tp_as_number@ */
   0,                                   /* @tp_as_sequence@ */
   0,                                   /* @tp_as_mapping@ */
-  gf_pyhash,                           /* @tp_hash@ */
+  mp_pyhash,                           /* @tp_hash@ */
   0,                                   /* @tp_call@ */
   mp_pyhex,                            /* @tp_str@ */
   0,                                   /* @tp_getattro@ */