kuuko pushed a commit to branch master.
commit 5043aa38f00d697c0cdf7baf449ff2ffd6f9e5cc
Author: davemds <[email protected]>
Date: Sun Mar 31 15:26:30 2013 +0000
Reorder _object_mapping_register for readability.
---
efl/eo/efl.eo.pyx | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index cf081f5..0ce1430 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -232,17 +232,13 @@ cdef Eina_Hash *object_mapping =
eina_hash_string_superfast_new(NULL)
cdef void _object_mapping_register(char *name, object cls) except *:
- cdef void *value
- #print("REGISTER: %s => %s" % (name, cls))
-
- value = eina_hash_find(object_mapping, name)
-
- if value == NULL:
- eina_hash_add(object_mapping, name, <PyObject *>cls)
- else:
+ if eina_hash_find(object_mapping, name) != NULL:
raise ValueError("Object type name '%s' already registered." % name)
+ #print("REGISTER: %s => %s" % (name, cls))
+ eina_hash_add(object_mapping, name, <PyObject *>cls)
+
cdef void _object_mapping_unregister(char *name):
eina_hash_del(object_mapping, name, NULL)
--
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2