diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-08-29 07:09:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-08-29 07:09:22 +0400 |
commit | 1e3b8dc5d716e7fc81f37a94855760680dc7da66 (patch) | |
tree | 3dcce91d0d87381ba8a6d28502372ab97f57d8d2 /source/blender/python | |
parent | 18478d1e62c39a1adb1f573e340bc14e36c2ed10 (diff) |
hash update from stable
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/api2_2x/gen_library.c | 13 | ||||
-rw-r--r-- | source/blender/python/api2_2x/gen_library.h | 2 |
2 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/python/api2_2x/gen_library.c b/source/blender/python/api2_2x/gen_library.c index d73c316d570..8673fefdbb5 100644 --- a/source/blender/python/api2_2x/gen_library.c +++ b/source/blender/python/api2_2x/gen_library.c @@ -325,17 +325,8 @@ PyObject *GetPyObjectFromID( ID * id ) Py_RETURN_NONE; } -/* return a unique tuple for this libdata*/ -long GenericLib_hash(PyObject * pydata) +long GenericLib_hash(BPy_GenericLib * pydata) { - ID *id = ((BPy_GenericLib *)pydata)->id; - PyObject *pyhash = PyTuple_New( 2 ); - long hash; - PyTuple_SetItem( pyhash, 0, PyString_FromString(id->name) ); - if (id->lib) PyTuple_SetItem( pyhash, 1, PyString_FromString(id->lib->name) ); - else PyTuple_SetItem( pyhash, 1, EXPP_incr_ret(Py_None) ); - hash = PyObject_Hash(pyhash); - Py_DECREF(pyhash); - return hash; + return (long)pydata->id; } diff --git a/source/blender/python/api2_2x/gen_library.h b/source/blender/python/api2_2x/gen_library.h index 74f34fd0019..9fb922619c2 100644 --- a/source/blender/python/api2_2x/gen_library.h +++ b/source/blender/python/api2_2x/gen_library.h @@ -90,5 +90,5 @@ short GenericLib_getType(PyObject * pydata); /* Other ID functions */ ID *GetIdFromList( ListBase * list, char *name ); PyObject *GetPyObjectFromID( ID * id ); -long GenericLib_hash(PyObject * pydata); +long GenericLib_hash(BPy_GenericLib * pydata); #endif /* EXPP_gen_library_h */ |