From: Philippe Proulx Date: Fri, 5 Dec 2014 02:35:31 +0000 (-0500) Subject: Python: remove useless 'return None' X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=decd548bce0fce8b2675e942646e273e0d1d84eb;p=deliverable%2Fbabeltrace.git Python: remove useless 'return None' A Python function's default return value is None already. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/bindings/python/bt.py b/bindings/python/bt.py index 48a1b49f8..047e2f003 100644 --- a/bindings/python/bt.py +++ b/bindings/python/bt.py @@ -177,9 +177,6 @@ class TraceCollection: ev_ptr = nbt._bt_ctf_iter_read_event(ctf_it_ptr) nbt._bt_ctf_iter_destroy(ctf_it_ptr) - if ev_ptr is None: - return None - def _events(self, begin_pos_ptr, end_pos_ptr): ctf_it_ptr = nbt._bt_ctf_iter_create(self._tc, begin_pos_ptr, end_pos_ptr) @@ -431,8 +428,6 @@ class Event(collections.Mapping): if field is not None: return field.value - return None - def field_list_with_scope(self, scope): """Return a list of field names in scope.""" @@ -474,9 +469,7 @@ class Event(collections.Mapping): trace_collection = TraceCollection() trace_collection._tc = nbt._bt_ctf_event_get_context(self._e) - if trace_collection._tc is None: - return None - else: + if trace_collection._tc is not None: return trace_collection def __getitem__(self, field_name): @@ -960,8 +953,6 @@ class _Definition: if definition_ptr is not None: return _Definition(definition_ptr, self.scope) - return None - def _get_uint64(self): """ Return the value associated with the field.