From fb6bc3a9f2e122a7c45c7188f1e0df13a810e420 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 17 Dec 2015 12:56:32 +0100 Subject: [PATCH] CallDistanceTransceiver.py: don't put the general case in an else 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. --- src/savemysugar/CallDistanceTransceiver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/savemysugar/CallDistanceTransceiver.py b/src/savemysugar/CallDistanceTransceiver.py index fd60a1f..c251673 100755 --- a/src/savemysugar/CallDistanceTransceiver.py +++ b/src/savemysugar/CallDistanceTransceiver.py @@ -143,10 +143,10 @@ class CallDistanceTransceiver(object): 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: -- 2.1.4