[pygobject] Don't check the inner type when comparing gpointers



commit 28ed01c34c503cfb4f14fe7af7912060ca70aba6
Author: Simón Pena <spenap gmail com>
Date:   Mon Sep 20 23:10:14 2010 +0200

    Don't check the inner type when comparing gpointers
    
    When using pyg_pointer_richcompare to compare two objects,
    don't check their inner types. As we can't compare their private
    fields, nor get a proper compare function, we can consider them
    gpointers and compare them that way.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629552

 gobject/pygpointer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gobject/pygpointer.c b/gobject/pygpointer.c
index fbe3e10..575c751 100644
--- a/gobject/pygpointer.c
+++ b/gobject/pygpointer.c
@@ -44,7 +44,7 @@ pyg_pointer_dealloc(PyGPointer *self)
 static PyObject*
 pyg_pointer_richcompare(PyObject *self, PyObject *other, int op)
 {
-    if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGPointer_Type)
+    if (Py_TYPE(self) == Py_TYPE(other))
         return _pyglib_generic_ptr_richcompare(((PyGPointer*)self)->pointer,
                                                ((PyGPointer*)other)->pointer,
                                                op);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]