Since the code returns when the particular case of the very first call
occurs, there is no need to put the general case in the else.
self.previous_call_time = current_ring_time
self.log_symbol(0, "", "(The very first ring)")
return
self.previous_call_time = current_ring_time
self.log_symbol(0, "", "(The very first ring)")
return
- else:
- ring_distance = current_ring_time - self.previous_ring_time
- logging.debug("RINGs distance: %.2f", ring_distance)
- self.previous_ring_time = current_ring_time
+
+ ring_distance = current_ring_time - self.previous_ring_time
+ logging.debug("RINGs distance: %.2f", ring_distance)
+ self.previous_ring_time = current_ring_time
# Ignore multiple rings in the same call
if abs(ring_distance - self.rings_distance) < self.ring_uncertainty:
# Ignore multiple rings in the same call
if abs(ring_distance - self.rings_distance) < self.ring_uncertainty: