From decd548bce0fce8b2675e942646e273e0d1d84eb Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 4 Dec 2014 21:35:31 -0500 Subject: [PATCH] Python: remove useless 'return None' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A Python function's default return value is None already. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- bindings/python/bt.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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. -- 2.34.1