summaryrefslogtreecommitdiff
path: root/efl/eo
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-12-06 10:51:11 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2013-12-06 10:51:11 +0200
commitca680c5a671158cea76a96b8e4630c087d68db99 (patch)
tree9d5735c08a84f7613f077f283d25c5026965d7b5 /efl/eo
parent43f961d04ac93f54fb025047c25d4fc286837f89 (diff)
Elementary: Add an optimization for _set_properties_from_keyword_args
Return early when kwargs dict is empty.
Diffstat (limited to 'efl/eo')
-rw-r--r--efl/eo/efl.eo.pyx2
1 files changed, 2 insertions, 0 deletions
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index 238359c..37e2e7b 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -240,6 +240,8 @@ cdef class Eo(object):
240 return 1 240 return 1
241 241
242 cdef int _set_properties_from_keyword_args(self, dict kwargs) except 0: 242 cdef int _set_properties_from_keyword_args(self, dict kwargs) except 0:
243 if not kwargs:
244 return 1
243 cdef list cls_list = dir(self) 245 cdef list cls_list = dir(self)
244 for k, v in kwargs.items(): 246 for k, v in kwargs.items():
245 assert k in cls_list, "%s has no attribute with the name %s." % (self, k) 247 assert k in cls_list, "%s has no attribute with the name %s." % (self, k)