Python: remove useless 'return None'
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 5 Dec 2014 02:35:31 +0000 (21:35 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 13 Feb 2015 17:11:10 +0000 (12:11 -0500)
A Python function's default return value is None already.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/bt.py

index 48a1b49f8c6e74582962254504c6e64b2a1b0ca4..047e2f003969e54f921cef802d768e21a8a384ca 100644 (file)
@@ -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.
This page took 0.025979 seconds and 4 git commands to generate.