From: Antonio Ospite Date: Thu, 17 Dec 2015 11:56:32 +0000 (+0100) Subject: CallDistanceTransceiver.py: don't put the general case in an else X-Git-Url: https://git.ao2.it/SaveMySugar/python3-savemysugar.git/commitdiff_plain/fb6bc3a9f2e122a7c45c7188f1e0df13a810e420?ds=inline 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. --- 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: